aboutsummaryrefslogtreecommitdiff
path: root/roles/linux_base/tasks
diff options
context:
space:
mode:
authorSam Chudnick <sam@chudnick.com>2023-06-25 09:52:36 -0400
committerSam Chudnick <sam@chudnick.com>2023-06-25 09:52:36 -0400
commit95b73daa36b23565a8566f71f9b202d3459b685f (patch)
treecb17b021be70e7868d0ec235a761f0ecdc80f3f2 /roles/linux_base/tasks
Initial CommitHEADmaster
Diffstat (limited to 'roles/linux_base/tasks')
-rw-r--r--roles/linux_base/tasks/main.yml57
1 files changed, 57 insertions, 0 deletions
diff --git a/roles/linux_base/tasks/main.yml b/roles/linux_base/tasks/main.yml
new file mode 100644
index 0000000..ef523ef
--- /dev/null
+++ b/roles/linux_base/tasks/main.yml
@@ -0,0 +1,57 @@
1- name: remove cloud config managed /etc/hosts
2 lineinfile:
3 path: /etc/cloud/cloud.cfg
4 regexp: ".*update_etc_hosts.*"
5 state: absent
6
7- name: set fully qualified hostname
8 notify:
9 - update and upgrade - debian
10 - update and upgrade - fedora
11 hostname:
12 name: "{{ ansible_hostname }}.{{ domain }}"
13
14- name: use https repos - debian
15 when: ansible_facts['distribution'] == 'Debian'
16 replace:
17 path: /etc/apt/sources.list
18 regexp: "http://"
19 replace: "https://"
20
21- name: install packages
22 package:
23 name: "{{ base_packages }}"
24 state: latest
25
26- name: allow ssh
27 when: ansible_facts['hostname'] != 'proxmox'
28 ufw:
29 rule: allow
30 name: ssh
31
32- name: reload ufw
33 when: ansible_facts['hostname'] != 'proxmox'
34 ufw:
35 state: reloaded
36
37- name: enable ufw
38 when: ansible_facts['hostname'] != 'proxmox'
39 ufw:
40 state: enabled
41
42- name: default deny incoming
43 when: ansible_facts['hostname'] != 'proxmox'
44 ufw:
45 default: deny
46 direction: incoming
47
48- name: default allow outgoing
49 when: ansible_facts['hostname'] != 'proxmox'
50 ufw:
51 default: allow
52 direction: outgoing
53
54- name: reload ufw
55 when: ansible_facts['hostname'] != 'proxmox'
56 ufw:
57 state: reloaded