- blockinfile:
path: /etc/apache2/sites-enabled/“{{ item }}”.php.qarea.org.conf
block: |
AssignUserId “{{ item }}” “{{ item }}”
insertbefore:
with_items:
“{{ sites }}”
TASK [blockinfile] ************************************************************************************************************************************************************************************************************************************************************
task path: /home/greg/projects/php-users.yaml:104
fatal: [php]: FAILED! => {
“failed”: true,
“msg”: “the field ‘args’ has an invalid value, which appears to include a variable that is undefined. The error was: ‘item’ is undefined\n\nThe error appears to have been in ‘/home/greg/projects/php-users.yaml’: line 104, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - blockinfile:\n ^ here\n”
}
sites variable is defined like this:
vars:
sites:
it seems like it doesn’t understand double reference to a variable in cycle like “{{ item }}” “{{ item }}”
what to do?
thanks a lot in advance