teaching-webterm/ansible/tasks/setup_sshwifty.yml

42 lines
958 B
YAML
Raw Normal View History

2022-05-26 15:31:39 +00:00
---
- name: Install required system packages
ansible.builtin.apt:
name:
- vim
state: latest
update_cache: true
2022-05-30 19:35:02 +00:00
- name: Create SSHwifty configuration directory
file:
path: "{{ sshwifty_configuration_directory }}"
state: directory
- name: Scan SSH keys
command: "ssh-keyscan {{item}}"
register: "host_keys"
changed_when: false
with_items: groups["role_mongos"]
2022-05-26 15:31:39 +00:00
- name: Deploy SSHwifty configuration
template:
src: templates/sshwifty.conf.j2
2022-05-30 19:35:02 +00:00
dest: "{{ sshwifty_configuration_directory }}/sshwifty.conf"
2022-05-26 15:31:39 +00:00
- name: Create SSHwifty directory
file:
2022-05-30 19:35:02 +00:00
path: "{{ sshwifty_work_directory }}"
2022-05-26 15:31:39 +00:00
state: directory
- name: Deploy SSHwifty configuration
template:
src: templates/docker-compose.yml.j2
2022-05-30 19:35:02 +00:00
dest: "{{ sshwifty_work_directory }}/docker-compose.yml"
2022-05-26 15:31:39 +00:00
- name: Run SSHwifty
community.docker.docker_compose:
2022-05-30 19:35:02 +00:00
project_src: "{{ sshwifty_work_directory }}"
2022-05-26 15:31:39 +00:00
recreate: smart
state: present
#