playbooks/
- files/
- public_keys/ <-- common keys used on multiple projects/servers
- galaxy_roles/
- group_vars/
- all/
- droplets/
- host_vars/
- project1/
- vars.yml
- vault.yml
- project2/
- vars.yml
- vault.yml
- roles/ <-- custom roles, as reusable and broken down as I can make them
- templates/
- iptables/
- project1/rules.j2 <-- each project may require different iptable rules
- project2/rules.j2
- project1.yml
- project2.yml--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fb912723-17ed-4480-8d99-93138501b934%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- playbooks/
- (as before)
- project/
- group_vars/
- all/
- web/
- templates/
- iptables/
- web/
- ansible.cfg
- hosts
- site.yml <-- just includes web.yml
- web.yml
As most of my projects only have a single host each, it's not very useful at this stage. Sure, if I need to scale the project I may need a few new hosts but right now it feels like each project should be a group in one big project.
So after converting my structure to the "each project has its own ansible.cfg and inventory" the worst issue I don't appear to be able to solve is targeting hosts in different projects. If I need to run an ad hoc command on all hosts, I literally have to enter each project directory and run the command. I could script around it somehow or maybe there's some clever shell expansion I could use, but it feels like going against what Ansible is good at: running against multiple hosts automatically.
As most of my projects only have a single host each, it's not very useful at this stage. Sure, if I need to scale the project I may need a few new hosts but right now it feels like each project should be a group in one big project.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bc95ba9e-1f9b-46d9-bf22-9aa876970bd6%40googlegroups.com.
Managing all projects, their webservers, future additional servers and DB servers etc, plus prod/staging/testing versions in one inventory isn't ideal either.
[web]
somehost[web]
some_other_hostfiles/ (public ssh keys and the like)
galaxy_roles/
group_vars/ (each project has its own group vars)
all
project1_web/
project1_db/
project2_web/
project2_db/
project3
backups
host_vars/ (not used)
roles/
templates/ (just used for firewall rule templates)
utils/ (adhoc commands that I sometimes use)
ansible.cfg
hosts
play_webservers_lamp.yml
play_webservers_lemp.yml
play_project3.yml
play_backups.yml
requirements.yml; Webservers
[webservers:children]
webservers_lamp
webservers_lemp
[webservers_lemp:children]
project1_web
project2_web
; Backup systems
[backup_systems]
backups
; Individual hosts
[project1_web]
project1_web1 ansible_host=1.1.1.1
[project2_web]
project2_web1 ansible_host=2.2.2.2
[backups]
backups1 ansible_host=9.9.9.9