This commit is contained in:
@ -1,26 +1,26 @@
|
||||
---
|
||||
- name: "Use custom Ubuntu mirror"
|
||||
ansible.builtin.replace:
|
||||
replace:
|
||||
path: /etc/apt/sources.list
|
||||
regexp: 'http://hu.archive.ubuntu.com'
|
||||
replace: 'https://mirror.niif.hu'
|
||||
backup: yes
|
||||
|
||||
- name: "Remove Ubuntu bloatware"
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
state: absent
|
||||
name: ubutu-server
|
||||
autoremove: yes
|
||||
|
||||
- name: "Update machine"
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
update_cache: yes
|
||||
upgrade: "yes"
|
||||
autoclean: yes
|
||||
autoremove: yes
|
||||
|
||||
- name: "Install my favourite applications"
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
update_cache: yes
|
||||
state: present
|
||||
name:
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: clean motd
|
||||
ansible.builtin.file:
|
||||
file:
|
||||
state: touch
|
||||
owner: tormakris@intra.tormakris.dev
|
||||
group: domain users@intra.tormakris.dev
|
||||
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
- name: disable cloudinit
|
||||
ansible.builtin.copy:
|
||||
copy:
|
||||
content: ""
|
||||
dest: /etc/cloud/cloud-init.disabled
|
||||
force: no
|
||||
|
||||
- name: disable network autoconfig
|
||||
ansible.builtin.copy:
|
||||
copy:
|
||||
content: "network: {config: disabled}"
|
||||
dest: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
||||
force: no
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: "Install node exporter"
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
update_cache: yes
|
||||
state: present
|
||||
name:
|
||||
@ -14,7 +14,7 @@
|
||||
src: 192.168.69.0/24
|
||||
|
||||
- name: Enable and restart exporter daemon
|
||||
ansible.builtin.service:
|
||||
service:
|
||||
name: prometheus-node-exporter
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: Remove snapd from Ubuntu
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
name: snapd
|
||||
state: absent
|
||||
purge: yes
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
|
||||
- name: Remove snapd-related directories
|
||||
ansible.builtin.file:
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
|
@ -1,24 +1,24 @@
|
||||
---
|
||||
- name: Disable root authentication
|
||||
ansible.builtin.replace:
|
||||
replace:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '#PermitRootLogin prohibit-password'
|
||||
replace: 'PermitRootLogin no'
|
||||
|
||||
- name: Disable X11 forwarding
|
||||
ansible.builtin.replace:
|
||||
replace:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: 'X11Forwarding yes'
|
||||
replace: 'X11Forwarding no'
|
||||
|
||||
- name: Explicitly only listen on ipv4
|
||||
ansible.builtin.replace:
|
||||
replace:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '#AddressFamily any'
|
||||
replace: 'AddressFamily inet'
|
||||
|
||||
- name: "Restart sshd"
|
||||
ansible.builtin.service:
|
||||
service:
|
||||
name: sshd
|
||||
state: restarted
|
||||
...
|
||||
|
@ -1,18 +1,18 @@
|
||||
---
|
||||
- name: Setup timesync config
|
||||
ansible.builtin.template:
|
||||
template:
|
||||
src: timesyncd.conf.template
|
||||
dest: /etc/systemd/timesyncd.conf
|
||||
notify: run Timedatectl
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- name: set Timezone
|
||||
ansible.builtin.timezone: name={{ timedatectl_timezone }}
|
||||
timezone: name={{ timedatectl_timezone }}
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- name: Reastart timesyncd to apply changes
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
systemd:
|
||||
state: restarted
|
||||
daemon_reload: yes
|
||||
name: systemd-timesyncd
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: "Install ufw via apt"
|
||||
ansible.builtin.apt:
|
||||
apt:
|
||||
update_cache: yes
|
||||
state: present
|
||||
name:
|
||||
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: Create .ssh directory of ansible user
|
||||
ansible.builtin.file:
|
||||
file:
|
||||
path: /home/ansible@intra.tormakris.dev/.ssh
|
||||
state: directory
|
||||
owner: ansible@intra.tormakris.dev
|
||||
group: domain users@intra.tormakris.dev
|
||||
|
||||
- name: Copy authorized_keys
|
||||
ansible.builtin.copy:
|
||||
copy:
|
||||
src: authorized_keys
|
||||
dest: /home/ansible@intra.tormakris.dev/.ssh/authorized_keys
|
||||
mode: 0600
|
||||
@ -15,7 +15,7 @@
|
||||
group: domain users@intra.tormakris.dev
|
||||
|
||||
- name: Check if group is present in sudoers
|
||||
ansible.builtin.lineinfile:
|
||||
lineinfile:
|
||||
state: absent
|
||||
path: /etc/sudoers
|
||||
regexp: "^%linuxadmins"
|
||||
@ -24,7 +24,7 @@
|
||||
register: checksudoers
|
||||
|
||||
- name: Define group in sudoers
|
||||
ansible.builtin.lineinfile:
|
||||
lineinfile:
|
||||
state: present
|
||||
path: /etc/sudoers
|
||||
line: "%linuxadmins@intra.tormakris.dev ALL=(ALL) NOPASSWD: ALL"
|
||||
|
Reference in New Issue
Block a user