- name: apply docker role
hosts: docker-hosts
roles:
- role: docker_host # role that make sure docker is up to date, running, deploys the right images, starts containers
- name: apply worker role
hosts: workers # group that contains all the containers started on the docker-hosts
roles:
- role: worker
- name: add container as host
add_host:
name: "{{ inventory_hostname }}-container"
ansible_host: "{{ ansible_eth0.ipv4.address }}"
ansible_port: "{{ ssh_port }}"
groups: workers
You know what, I tried to be civil and do this the right way, but you've simply pushed me too far.
So, until I have some kind of answer about why add_host
bypasses the host loop and what the idiomatic way to accomplish this is, I'm just going to say 'to hell with it' and unbypass that shizz.
That's right, I LIVE DANGEROUS. Deal with it.
ansible/plugins/action/add_host.py, line 40:
BYPASS_HOST_LOOP = False # biatch!
which yields:
TASK [docker_host : run deployable image] ************************
ok: [h2]
ok: [h1]
TASK [docker_host : add container as host] ******************************
changed: [h1]
changed: [h2]
I'm still certain there's some perfectly valid reason they have this disabled, but what we've got here is failure to communicate. Some developers you just can't reach. So you get what we have here, which is the way they wants it. Well, they gets it. I don't like it any more than you.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b88113ac-5125-42f1-8853-623d77a48d49%40googlegroups.com.--
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.