Simplify config and rename some files
This commit is contained in:
parent
01d9d3c04b
commit
3b7c096f8e
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
- name: Gather facts
|
|
||||||
gather_facts:
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
- import_tasks: ssh.yml
|
- import_tasks: ssh-port.yml
|
||||||
tags: [change-ssh-port]
|
tags: [change-ssh-port]
|
||||||
- import_tasks: facts.yml
|
- import_tasks: virtualization.yml
|
||||||
tags: [gather-facts]
|
tags: [gather-virtualization-facts]
|
||||||
- import_tasks: dell-apt-repo.yml
|
- import_tasks: dell-apt-repo.yml
|
||||||
tags: [setup-dell-apt-repo]
|
tags: [setup-dell-apt-repo]
|
||||||
when: ansible_virtualization_role != "guest"
|
when: ansible_virtualization_role != "guest"
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
ansible_port: 22
|
ansible_port: 22
|
||||||
when: ssh_configured is defined and
|
when: ssh_configured is defined and
|
||||||
(ssh_configured.state is undefined or
|
ssh_configured.state is undefined and
|
||||||
(ssh_configured.state is defined and
|
|
||||||
ssh_configured.state != "started")) and
|
|
||||||
ansible_port != 2222
|
ansible_port != 2222
|
||||||
|
|
||||||
- name: Change SSH port on host
|
- name: Change SSH port on host
|
||||||
|
@ -29,9 +27,7 @@
|
||||||
register: ssh_changed
|
register: ssh_changed
|
||||||
notify: "Restart sshd"
|
notify: "Restart sshd"
|
||||||
when: ssh_configured is defined and
|
when: ssh_configured is defined and
|
||||||
(ssh_configured.state is undefined or
|
ssh_configured.state is undefined
|
||||||
(ssh_configured.state is defined and
|
|
||||||
ssh_configured.state != "started"))
|
|
||||||
|
|
||||||
- name: Ensure sshd is reloaded if needed
|
- name: Ensure sshd is reloaded if needed
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
4
roles/ubuntu_base/tasks/virtualization.yml
Normal file
4
roles/ubuntu_base/tasks/virtualization.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: Find out if running in a VM
|
||||||
|
setup:
|
||||||
|
gather_subset: virtualization_role
|
Loading…
Reference in a new issue