forked from data.coop/ansible
Sam A.
5a63e8e1a8
Co-authored-by: Sam A. <samsapti@noreply@git.data.coop> Co-committed-by: Sam A. <samsapti@noreply@git.data.coop>
21 lines
422 B
YAML
21 lines
422 B
YAML
---
|
|
- name: Change SSH port on host
|
|
lineinfile:
|
|
dest: "/etc/ssh/sshd_config"
|
|
regexp: "^#?Port "
|
|
line: "Port 19022"
|
|
register: ssh_changed
|
|
|
|
- name: Restart sshd
|
|
service:
|
|
name: sshd
|
|
state: restarted
|
|
when: ssh_changed is defined and
|
|
ssh_changed.changed
|
|
|
|
- name: Change Ansible port to 19022
|
|
set_fact:
|
|
ansible_port: 19022
|
|
when: ssh_changed is defined and
|
|
ssh_changed.changed
|