Argh, the second example should say "foo: bar" instead of foo=bar :-)

Tomasz Kontusz <[email protected]> napisał:
> 
>You are passing a list to lineinfile, and you should either pass in a
>string or a dictionary:
>
>  lineinfile: arg1=val1 foo=bar
>
>Or (IMHO better, as it has less problems with escaping):
>
>  lineinfile:
>    arg1: 'val1'
>    foo='bar'
>
>Willard Dennis <[email protected]> napisał:
>>Hi all,
>>
>>Trying to add a line (or modify if existing) to "sshd_config" to lock
>>down 
>>who can SSH to the target server. On RHEL, there is no "AllowGroups"
>>(or 
>>"AllowUsers") line present in the as-shipped sshd_config file. In any
>>case, 
>>here is the play I wrote:
>>
>>- name: RHELFAM | Restrict SSH on Docker hosts to specific group
>>members
>>  lineinfile:
>>    - dest=/etc/ssh/sshd_config
>>    - state=present
>>    - regexp='^AllowGroups '
>>    - line='AllowGroups {{ ssh_allow_groups }}'
>>    - validate='/usr/sbin/sshd -t %s'
>>  when: ssh_allow_groups is defined
>>  notify:
>>    - reload sshd
>>  tags: limitsshusers
>>
>>Then in roles/<rolename>/vars/main.yml:
>>
>>---
>>ssh_allow_groups:
>>  - root
>>  - wheel
>>
>>
>>But when I run the playbook containing the play above, I'm getting the
>
>>error mssg:
>>ERROR: action specified for task RHELFAM | Restrict SSH on Docker
>hosts
>>to 
>>specific group members has invalid type <type 'list'>
>>
>>What am I doing wrong?
>>
>>Thanks,
>>Will
>
>-- 
>Wysłane za pomocą K-9 Mail.

-- 
Wysłane za pomocą K-9 Mail.

-- 
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/d53d45dc-b785-4351-b122-ff46f9194fcf%40email.android.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to