start.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. - name: Launch instances
  2. hosts: work
  3. gather_facts: no
  4. vars:
  5. aws_pub_ip: true
  6. roles:
  7. - ec2_launch
  8. - name: Initial setup
  9. hosts: work
  10. become: yes
  11. vars:
  12. hostname_domain: "{{ aws_tag_name }}.{{ route53_zone }}"
  13. hostname_fqdn: "{{ aws_tag_value }}.{{ hostname_domain }}"
  14. hostname_tag: gluster
  15. hostname_tag_domain: "{{ hostname_tag }}.{{ route53_zone }}"
  16. hostname_cluster: "{{ groups.gluster }}"
  17. roles:
  18. - timezone
  19. - hostname
  20. - sshd_config
  21. - updates
  22. - base_user
  23. - { role: updates, repeat: 1 }
  24. tasks:
  25. - name: Reboot (if needed)
  26. reboot:
  27. when: reboot_force
  28. - name: Mount gluster homedir
  29. hosts: work
  30. become: yes
  31. vars:
  32. gluster_mnt_srv: "{{ groups.gluster | first }}"
  33. gluster_mnt_bkp: "{{ groups.gluster | join(':') }}"
  34. roles:
  35. - key_store
  36. - gluster
  37. - { role: gluster_mnt,
  38. gluster_mnt_vol: zib,
  39. gluster_mnt_path: /home/zib,
  40. gluster_mnt_mode: '0750',
  41. gluster_mnt_owner: zib,
  42. }
  43. - base_user
  44. - name: Install docker
  45. hosts: work
  46. become: yes
  47. vars:
  48. docker_run: true
  49. docker_glusterfs_servers: "{{ groups.gluster | join(',') }}"
  50. roles:
  51. - docker
  52. - docker_glusterfs
  53. - name: Additional vols
  54. ansible.builtin.import_playbook: vols.yaml