Skip to content

Commit f42e4e2

Browse files
committed
more consistent ssh deployment
1 parent f958ee6 commit f42e4e2

File tree

4 files changed

+42
-53
lines changed

4 files changed

+42
-53
lines changed

main.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
- vars.yml
1010

1111
roles:
12-
- auto-update
12+
# - auto-update
1313
- base
14-
- aws
15-
- brave
16-
- chrome
17-
# - docker-cli-only
18-
- docker-desktop-dependency
19-
- gh_cli
20-
- hashicorp
21-
- keepassxc
22-
- kubectl
23-
- microsoft
24-
- mullvad
25-
- opera
26-
- signal-desktop
27-
- sublime-text
28-
- trivy
29-
- role: vim
30-
become: false
31-
- role: env
32-
become: false
33-
- disable-local-dns
14+
# - aws
15+
# - brave
16+
# - chrome
17+
# # - docker-cli-only
18+
# - docker-desktop-dependency
19+
# - gh_cli
20+
# - hashicorp
21+
# - keepassxc
22+
# - kubectl
23+
# - microsoft
24+
# - mullvad
25+
# - opera
26+
# - signal-desktop
27+
# - sublime-text
28+
# - trivy
29+
# - role: vim
30+
# become: false
31+
# - role: env
32+
# become: false
33+
# - disable-local-dns
3434
# - yubico

roles/base/tasks/autostart.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
owner: "{{ local_user }}"
88
group: "{{ local_user_primary_group }}"
99

10-
- name: enable firefox autostart
11-
copy:
12-
src: autostart/firefox.desktop
13-
dest: "/home/{{ local_user }}/.config/autostart/"
14-
mode: 0644
15-
owner: "{{ local_user }}"
16-
group: "{{ local_user_primary_group }}"
10+
# - name: enable firefox autostart
11+
# copy:
12+
# src: autostart/firefox.desktop
13+
# dest: "/home/{{ local_user }}/.config/autostart/"
14+
# mode: 0644
15+
# owner: "{{ local_user }}"
16+
# group: "{{ local_user_primary_group }}"
1717

1818
- name: enable gnome-keyring-ssh autostart
1919
copy:

roles/base/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
- name: snap packages
99
import_tasks: snap.yml
1010

11-
- name: authentication tasks
12-
import_tasks: authentication.yml
11+
- name: ssh tasks
12+
import_tasks: ssh.yml
1313

1414
- name: security tasks
1515
import_tasks: security.yml

roles/base/tasks/authentication.yml renamed to roles/base/tasks/ssh.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
33
ansible.builtin.find:
44
paths: /etc/ssh/sshd_config.d/
55
file_type: file
6-
register: sshd_config_files
6+
register: sshd_config_d_files
77

88
- name: Remove all files in /etc/ssh/sshd_config.d/
99
ansible.builtin.file:
1010
path: "{{ item.path }}"
1111
state: absent
12-
loop: "{{ sshd_config_files.files }}"
13-
when: sshd_config_files.matched > 0
14-
15-
- name: Ensure /etc/ssh/sshd_config.d/ directory exists
16-
ansible.builtin.file:
17-
path: /etc/ssh/sshd_config.d/
18-
state: directory
19-
owner: root
20-
group: root
21-
mode: '0755'
12+
loop: "{{ sshd_config_d_files.files }}"
13+
loop_control:
14+
label: "{{ item.path }}"
15+
when: sshd_config_d_files.matched > 0
2216

2317
- name: Copy custom sshd_config.conf to /etc/ssh/sshd_config.d/
2418
ansible.builtin.copy:
@@ -29,25 +23,20 @@
2923
mode: '0644'
3024

3125

32-
- name: Remove all files in /etc/ssh/ssh_config.d but keep the directory
26+
- name: Find all files in /etc/ssh/ssh_config.d/
3327
ansible.builtin.find:
3428
paths: /etc/ssh/ssh_config.d/
3529
file_type: file
36-
register: files_to_remove
30+
register: ssh_config_d_files
3731

38-
- name: Delete files in /etc/ssh/ssh_config.d
32+
- name: Remove all files in /etc/ssh/ssh_config.d/
3933
ansible.builtin.file:
4034
path: "{{ item.path }}"
4135
state: absent
42-
loop: "{{ files_to_remove.files }}"
43-
44-
- name: Ensure /etc/ssh/ssh_config.d/ directory exists
45-
ansible.builtin.file:
46-
path: /etc/ssh/ssh_config.d/
47-
state: directory
48-
owner: root
49-
group: root
50-
mode: '0755'
36+
loop: "{{ ssh_config_d_files.files }}"
37+
loop_control:
38+
label: "{{ item.path }}"
39+
when: ssh_config_d_files.matched > 0
5140

5241
- name: Copy ssh_config to /etc/ssh/ssh_config.d/
5342
ansible.builtin.copy:

0 commit comments

Comments
 (0)