aboutsummaryrefslogtreecommitdiff
path: root/src/system/tasks/main.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'src/system/tasks/main.yaml')
-rw-r--r--src/system/tasks/main.yaml46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/system/tasks/main.yaml b/src/system/tasks/main.yaml
new file mode 100644
index 0000000..f03c02b
--- /dev/null
+++ b/src/system/tasks/main.yaml
@@ -0,0 +1,46 @@
+- name: Wireguard Setup
+ block:
+ - name: Install Wireguard
+ ansible.builtin.dnf:
+ name: wireguard-tools
+ state: latest
+ - name: Copy Wireguard configuartion
+ ansible.builtin.copy:
+ src: "{{ config.system.wireguard.wg_path }}"
+ dest: /etc/wireguard/
+ backup: yes
+ - name: Setup WG Systemd service
+ ansible.builtin.copy:
+ src: "systemd/sys/wireguard.service"
+ dest: /etc/systemd/system/
+ backup: yes
+ - name: Enable wireguard service
+ systemd:
+ state: started
+ name: wireguard.service
+ when: 'config.system.install_wireguard'
+
+- name: Systemd setups
+ block:
+ - name: Copying user systemd configs
+ ansible.builtin.copy:
+ src: "systemd/user/{{ item }}.service"
+ dest: "/home/{{ config.username }}/.config/systemd/user/"
+ loop: "{{ systemd }}"
+
+ - name: Enable service
+ become: yes
+ become_user: aaditya
+ systemd:
+ scope: user
+ state: started
+ name: "{{ item }}.service"
+ loop: "{{ systemd }}"
+ when: 'config.system.install_systemd'
+
+
+- name: Setup DNF conf
+ ansible.builtin.copy:
+ src: "dnf/dnf.conf"
+ dest: /etc/dnf/dnf.conf
+ backup: yes