Hi,
Am I doing this wrong? I’m not sure if I’m doing the only_if correctly?
-
name: copy a better SSH Config
action: copy src=…/…/…/global/templates/sshd_config.j2 dest=/etc/ssh/sshd_config owner=root group=root mode=0644
tags: -
ConfigureSSH
-
name: Copy Security Banner
action: copy src=…/…/…/global/files/banner dest=/etc/banner owner=root group=root mode=0644
tags: -
ConfigureSSH
-
DeployBanner
-
name: Check to see if the sshd config has the banner config and add it if it doesn’t
action: lineinfile dest=/etc/ssh/sshd_config regexp=“Banner /etc/banner” line=“Banner /etc/banner” insertafter=EOF state=present backup=yes
tags: -
ConfigureSSH
-
DeployBanner
-
name: If we added the banner config restart SSHd
action: service name=sshd state=restarted
only_if: ‘${last_result.changed}’
tags: -
ConfigureSSH
-
DeployBanner
ok: [ws023.frolickinglama.com]