-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfedora-server-setup.yaml
More file actions
72 lines (65 loc) · 1.93 KB
/
fedora-server-setup.yaml
File metadata and controls
72 lines (65 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
- name: Fedora server configuration
become: true
gather_facts: true
hosts: "{{ target_host }}"
vars_prompt:
- name: target_host
prompt: "Enter the target host name defined in the inventory file"
private: false
- name: target_hostname
prompt: "Enter the desired hostname for the target host"
private: false
vars_files:
- fedora-server-vars.yaml
tasks:
- name: Setting hostname
ansible.builtin.hostname:
name: "{{ target_hostname }}"
use: systemd
- name: Update RHEL,Fedora,CentOS hosts
ansible.builtin.dnf:
name: '*'
state: latest
update_cache: true
retries: 4
when:
- ansible_os_family == "RedHat"
register: rhel_update_status
- name: Reboot all updated machines and wait for it to boot
ansible.builtin.reboot:
reboot_timeout: 600
test_command: "whoami"
when: rhel_update_status.changed
- name: Add the Tailscale repository
ansible.builtin.get_url:
url: https://pkgs.tailscale.com/stable/fedora/tailscale.repo
dest: /etc/yum.repos.d/tailscale.repo
mode: '0644'
- name: Install required packages
ansible.builtin.dnf:
name: "{{ item }}"
state: present
update_cache: true
loop:
- "{{ dnf_packages }}"
- "{{ dnf_groups }}"
- name: Add the flathub flatpak repository
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Allow cockpit in firewalld
ansible.posix.firewalld:
port: 9090/udp
zone: public
permanent: true
state: enabled
- name: Enable system services
ansible.builtin.systemd_service:
name: "{{ item }}"
enabled: true
state: started
daemon_reload: true
with_items:
- "{{ sys_services }}"