aboutsummaryrefslogtreecommitdiff
path: root/src/system/tasks/main.yaml
blob: f03c02bb1088de3931252a4ec869f4114965d743 (plain) (blame)
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
- 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