main.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. - yum:
  3. name: openshift-ansible-inventory
  4. state: present
  5. - template:
  6. src: multi_ec2.yaml.j2
  7. dest: /etc/ansible/multi_ec2.yaml
  8. group: "{{ oo_inventory_group }}"
  9. owner: "{{ oo_inventory_owner }}"
  10. mode: "0640"
  11. - file:
  12. state: directory
  13. dest: /etc/ansible/inventory
  14. owner: root
  15. group: libra_ops
  16. mode: 0750
  17. - file:
  18. state: link
  19. src: /usr/share/ansible/inventory/multi_ec2.py
  20. dest: /etc/ansible/inventory/multi_ec2.py
  21. owner: root
  22. group: libra_ops
  23. # This cron uses the above location to call its job
  24. - name: Cron to keep cache fresh
  25. cron:
  26. name: 'multi_ec2_inventory'
  27. minute: '*/10'
  28. job: '/usr/share/ansible/inventory/multi_ec2.py --refresh-cache &> /dev/null'
  29. when: oo_cron_refresh_cache is defined and oo_cron_refresh_cache
  30. - name: Set cache location
  31. file:
  32. state: directory
  33. dest: "{{ oo_inventory_cache_location | dirname }}"
  34. owner: root
  35. group: libra_ops
  36. recurse: yes
  37. mode: '2750'
  38. when: oo_inventory_cache_location is defined