This could probably be done much better so any advice is welcome. I have a 
file called "deploy_list" inside the "group_vars" folder. It's a list of 
modules that needs to be deployed. During any given deploy, the deployment 
person lists the modules he wishes to deploy. The list of modules differs 
for each deploy so the file is dynamic.

Without having to pass "--tags=perl" if he knows only PERL modules are 
being deployed, I would rather have the script skip the PHP tasks if no 
variables are set. See below ... this would fail w/ the following msg.


TASK: [Export PHP code from SVN] 
**********************************************
fatal: [127.0.0.1] => with_dict expects a dict



# cat deploy_list

deploy_php_modules:

deploy_perl_modules:
   module_name:
     tag: '20140514r1_6.21_Amadeus'
     svn_path: '/projects/module_name'
     document_root: '/tmp'

# cat site.yml

- hosts: 127.0.0.1
  gather_facts: no
  connection: local
  user: deployment

  vars_files:
    - "group_vars/deploy_list"

  tasks:
    - name: Export PHP code from SVN
      action: shell svn export {{ item.value.svn_path }} {{ 
item.value.document_root }}
      with_dict: deploy_php_modules
      tags: php

    - name: Export PERL code from SVN
      action: shell svn export {{ item.value.svn_path }} {{ 
item.value.document_root }}
      with_dict: deploy_perl_modules
      tags: perl


-- 
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/f6e985b1-ad32-44ed-86f4-9abed5d77f31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to