My ansible version:
etdev@rlotttrustystock101012240:~$ ansible --version
ansible 1.9.2
configured module search path = None
I am using a local connection (i.e. doing stuff on my local machine).
In my playbook, I have the following line that checks out additional code
repos to build using the git module:
- name: Checkout src directories
register: repos_state
git: repo={{ item.value.url }} dest={{ item.value.checkout_dir }}
version={{ item.value.revision }} force=true
with_dict: "{{ repos }}"
The repos variable is defined something like this:
repos:
dcs:
url: "http://supersecretrepo/dcsurl.git"
revision: 283fa10
checkout_dir: "{{ srcdir }}/dcs"
build_dir: "{{ srcdir }}/dcs"
ecp:
url: "http://supersecretrepo/ecpurl.git"
revision: fad759e
checkout_dir: "{{ srcdir }}/ecp"
build_dir: "{{ srcdir }}/ecp"
vue:
url: "http://supersecretrepo/vueurl.git"
revision: dc9acab
checkout_dir: "{{ srcdir }}/vue/vue"
build_dir: "{{ srcdir }}/vue"
I have a task following this that builds stuff from these repositories:
- name: Build the software
shell: nohup make deb > /tmp/{{ item.key }}-build.txt chdir={{ item.
value.build_dir }}
with_dict: "{{ repos }}"
when: repos_state.changed
So, when the variable repos_state shows an overall change, then it will
rebuild *ALL* the software locations.
What I would like to know is if there is a more fine grained way to do
this. Let's say that I update the revision for repo dcs. In this case, I
want my build software to only build the one that has changed. I have tried
to figure out how to do this but haven't had much luck.
Does anyone have a suggestion about how I could do this? I tried "when:
repos_state[ {{item.key}} ].changed" but that didn't work.
I'm still fairly new to Ansible so I apologize if my question is simple.
Thanks.
Rodney
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/76ae4f27-6a76-434c-8f1f-d96f2f6ce89d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.