Hi Benjamin Look at specifying variables using group_vars or host_vars (see http://docs.ansible.com/intro_inventory.html#splitting-out-host-and-group-specific-data )
There is a special group 'all' of which all hosts are automatically a member. Regards Tom On 14 January 2015 at 02:15, Benjamin Arntzen <[email protected]> wrote: > Hi there, > > I'm trying to build python 3.4.2 in a semi-idempotent way. I see > mpdehaan's comments on it and didn't have any issues following those. > > The issue I'm having is that the variables defined in common.yml aren't > being carried through to the second play (python-app-server). I would like > to simply define vars_files in the first play and have it carry forward. Am > I just thinking about it wrong? > > Here's my playbook's site.yml file, as I would like it to look: > --- > # file: site.yml > - hosts: all > user: '{{ deploy_user }}' > sudo: yes > vars_files: > - vars/common.yml > - [ "vars/{{ ansible_os_family }}.yml", "vars/os_defaults.yml" ] > > > roles: > - base > - redacted-base > > > - hosts: python-app-server > user: '{{ deploy_user }}' > roles: > - python-app-server > > And here's how it has to look in order to work at the moment: > > --- > # file: site.yml > - hosts: all > user: '{{ deploy_user }}' > sudo: yes > vars_files: > - vars/common.yml > - [ "vars/{{ ansible_os_family }}.yml", "vars/os_defaults.yml" ] > > > roles: > - base > - redacted-base > > > - hosts: python-app-server > user: '{{ deploy_user }}' > vars_files: > - vars/common.yml > roles: > - python-app-server > > I'm totally unconcerned about adding two lines, I just want a much cleaner > way to express this. Thoughts? > > Thanks, > ~ B > > -- > 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/b015d643-17f6-4298-8c5e-64a5e32804d9%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/b015d643-17f6-4298-8c5e-64a5e32804d9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAAnNz0NAaA4iX7mjya8Qit-2-uVWHZU%3D325Rn%3DSVYj%2Bo95qSMA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
