benocs_certificates:- domain: 'foo.bar' #... challenge: # O tohle misto mi jde :] Item je /definovany/ diky loop v template file. # Ale to asi nedava smysl protoze promenne se vyhodnocuji drive. # Jak to vyresit? http_dir: '{{item.domain}}' http_path: '/var/www/{{item.challenge.http_dir}}' - domain: 'anotherfoo.bar' # ... challenge: # What the directory of the webserver is # Default item.domain http_dir: '{{item.domain}}' # Whole path to the web folder # default: '/var/www/{{item.challenge.http_dir}}' http_path: '/var/www/{{item.challenge.http_dir}}'
benocs.com;/var/www/{{item.challenge.http_dir}};dummy_web1
benocs.com;/var/www/benocs.com;dummy_web1
{% for host in groups['benocs_certificates'] %}{% for item in hostvars[host].benocs_certificates %}{{item.domain}};{{item.challenge.http_path}};{{host}}{% endfor %}{% endfor %}
- name: 'Build the http challenge config file on controller' template: src: templates/benocs_certificates/challenge_paths.csv.j2 dest: '{{benocs_certificates_master_dehydrated_path}}/challenge_paths.csv'