Я обнаружил, что meta: refresh_inventory
недостаточно. Я должен был сначала добавить явный вызов ec2.py --refresh-cache
.
- name: refresh inventory hosts: localhost connection: local gather_facts: False tasks: - name: Refresh EC2 cache command: /etc/ansible/ec2.py --refresh-cache - name: Refresh in-memory EC2 cache meta: refresh_inventory