Initial commit

This commit is contained in:
mustard 2024-11-23 20:58:45 +01:00
commit ae63be1df6
9 changed files with 421 additions and 0 deletions

26
tasks/ssh_config.yaml Normal file
View file

@ -0,0 +1,26 @@
- name: My first play
hosts: myhosts
tasks:
# - name: Ping my hosts
# ansible.builtin.ping:
# - name: Reboot machine
# ansible.builtin.reboot:
# msg: "Rebooting machine..."
# - name: Print message
# ansible.builtin.debug:
# msg: Hello world
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: root
key: "{{ lookup('file', './config/id_ed25519.pub') }}"
- name: Copy over SSHD config file
ansible.builtin.copy:
src: ./config/sshd_config
dest: /etc/ssh/sshd_config
owner: root
group: root
mode: '0600'
- name: Restart SSHD
service:
name: sshd
state: restarted