make this when defined
This commit is contained in:
parent
3e4aee5e15
commit
2e0b111660
1 changed files with 3 additions and 3 deletions
|
@ -10,20 +10,20 @@
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
with_items:
|
with_items:
|
||||||
- /root/.ssh/known_hosts
|
- /root/.ssh/known_hosts
|
||||||
when: birthday is true
|
when: birthday is defined
|
||||||
|
|
||||||
- name: gather ssh host key from new instance
|
- name: gather ssh host key from new instance
|
||||||
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
register: hostkey
|
register: hostkey
|
||||||
when: birthday is true
|
when: birthday is defined
|
||||||
|
|
||||||
- name: add new ssh host key (until we can sign it)
|
- name: add new ssh host key (until we can sign it)
|
||||||
local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}" host={{ inventory_hostname }} state=present
|
local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}" host={{ inventory_hostname }} state=present
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
with_items:
|
with_items:
|
||||||
- /root/.ssh/known_hosts
|
- /root/.ssh/known_hosts
|
||||||
when: birthday is true
|
when: birthday is defined
|
||||||
|
|
||||||
- name: check if sshd port is already known by selinux
|
- name: check if sshd port is already known by selinux
|
||||||
shell: semanage port -l | grep ssh
|
shell: semanage port -l | grep ssh
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue