В ansible 1.5.4 безупречно работала следующая команда:
- name: Generate postfix dhparams
command: "{{ item }}"
with_items:
- openssl gendh -out /etc/postfix/dh_512.pem -2 512 creates=/etc/postfix/dh_512.pem
- openssl gendh -out /etc/postfix/dh_2048.pem -2 2048 creates=/etc/postfix/dh_2048.pem
notify: Reload postfix
После обновления до 1.9.1 команда не работает с ошибкой fatal: [127.0.0.1] => A variable inserted a new parameter into the module args. Be sure to quote variables if they contain equal signs (for example: "{{var}}").
ошибка.
Так как {{ item }}
это уже цитаты, не знаю что не так.
Как мне снова заставить эту команду работать?
Посмотри на https://github.com/ansible/ansible/issues/8260 для получения подробной информации о том, почему было сделано это изменение в поведении (чтобы предотвратить добавление дополнительных аргументов в командный модуль). Следующий формат должен работать:
- name: Generate postfix dhparams
command: "{{ item.command }} creates={{ item.file}}"
with_items:
- { command: 'openssl gendh -out /etc/postfix/dh_512.pem -2 512', file: '/etc/postfix/dh_512.pem' }
- { command: 'openssl gendh -out /etc/postfix/dh_2048.pem -2 2048', file: '/etc/postfix/dh_2048.pem' }
notify: Reload postfix