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

-- 
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/d21c040a-6349-4a0c-800a-0da2205fd3ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to