main.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - action: "{{ ansible_pkg_mgr }} name={{ item}} state=present"
  3. with_items:
  4. - openshift-ansible-inventory
  5. - openshift-ansible-inventory-aws
  6. - openshift-ansible-inventory-gce
  7. when: not openshift.common.is_containerized | bool
  8. - name:
  9. copy:
  10. content: "{{ oo_inventory_accounts | to_nice_yaml }}"
  11. dest: /etc/ansible/multi_inventory.yaml
  12. group: "{{ oo_inventory_group }}"
  13. owner: "{{ oo_inventory_owner }}"
  14. mode: "0640"
  15. - file:
  16. state: directory
  17. dest: /etc/ansible/inventory
  18. owner: root
  19. group: libra_ops
  20. mode: 0750
  21. - file:
  22. state: link
  23. src: /usr/share/ansible/inventory/multi_inventory.py
  24. dest: /etc/ansible/inventory/multi_inventory.py
  25. owner: root
  26. group: libra_ops
  27. # This cron uses the above location to call its job
  28. - name: Cron to keep cache fresh
  29. cron:
  30. name: 'multi_inventory'
  31. minute: '*/10'
  32. job: '/usr/share/ansible/inventory/multi_inventory.py --refresh-cache &> /dev/null'
  33. when: oo_cron_refresh_cache is defined and oo_cron_refresh_cache
  34. - name: Set cache location
  35. file:
  36. state: directory
  37. dest: "{{ oo_inventory_cache_location | dirname }}"
  38. owner: root
  39. group: libra_ops
  40. recurse: yes
  41. mode: '2770'
  42. when: oo_inventory_cache_location is defined