Thanks for your answer Matt, but unfortunately it hasn't worked :(.

- name: Setting log level in development
  lineinfile:
    dest=/etc/php5/fpm/php.ini
    regexp="{{ item.regexp }}"
    line="{{ item.line }}"
    backrefs=yes
  with_items: php_ini_settings


fatal: [192.168.33.9] => One or more undefined variables: 'str object' has 
no attribute 'regexp'




El viernes, 21 de marzo de 2014 13:15:07 UTC+1, Matt Martz escribió:
>
> There are a couple of things going on here, but the end solution I believe 
> is going to be:
>
> with_items: php_ini_settings
>
> What you are doing is creating a list of lists, and php_ini_settings is 
> being treated as a string.  Since php_ini_settings is already a list, just 
> use the line I referenced above.
>
> -- 
> Matt Martz
> [email protected] <javascript:>
>
> On March 21, 2014 at 12:10:24 AM, Simón Muñoz 
> ([email protected]<javascript:>) 
> wrote:
>
>  Hi all,
>
> I have tried all that I could think about this, but I wasn't able to use a 
> list inside a lineinfile call. This is my task code:
>
>  - name: php.ini hardening
>   lineinfile:
>     dest=/etc/php5/fpm/php.ini
>     regexp="{{ item.regexp }}"
>     line="{{ item.line }}"
>     backrefs=yes
>   with_items:
>     - php_ini_settings
>  
>  And this is an example list:
>
>   # roles/php-fpm/vars/main.yml
> ---
> php_ini_settings:
>   - regexp: "memory_limit = 128M"
>     line: "{{ memory_limit }}"
>   - regex: "post_max_size = 8M"
>     line: "{{ post_max_size }}"
>  
>  The fatal error: 
>  fatal: [192.168.33.9] => One or more undefined variables: 'str object' 
> has no attribute 'regexp'
>  
>
> Anyone has a clue about this? Thanks in advance!
>
>
>  --
> 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] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/59e76ce9-a1d8-4484-b753-9143d35db46f%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/59e76ce9-a1d8-4484-b753-9143d35db46f%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/1d73b7fe-d30c-4278-8744-2d36b0b721a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to