Nicolas Meienberger 3 anni fa
parent
commit
524a4e2e20

+ 3 - 2
ansible/setup.yml

@@ -3,8 +3,9 @@
   become: yes
 
   tasks:
-    - import_tasks: ./tasks/arch/essential.yml
-    - import_tasks: ./tasks/zsh.yml
+    - import_tasks: ./tasks/common/essential.yml
+    - import_tasks: ./tasks/common/zsh.yml
+    - import_tasks: ./tasks/common/docker.yml
     - import_tasks: ./tasks/network/avahi.yml
     # - import_tasks: tasks/zsh.yml
     # - import_tasks: tasks/nginx.yml

+ 0 - 1
ansible/tasks/common/docker.yml

@@ -2,7 +2,6 @@
   package:
     name: docker
     state: latest
-  when: not docker_status.stat.exists
 
 - name: Install essential packages
   package:

+ 3 - 0
ansible/tasks/common/essential.yml

@@ -1,3 +1,6 @@
+- name: Change machine hostname to tipi.local
+  shell: hostnamectl set-hostname tipi.local
+
 - name: Update packages
   become: yes
   pacman:

+ 5 - 5
ansible/tasks/network/avahi.yml

@@ -23,9 +23,9 @@
     regexp: '^hosts:.*'
     line: 'hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns'
 
-- name: Allow port 5353
-  ufw:
-    action: allow
+- name: Allow port 5353 in UFW
+  community.general.ufw:
+    rule: allow
     port: 5353
     proto: udp
 
@@ -34,11 +34,11 @@
     src: "{{ playbook_dir }}/templates/avahi/tipi.service"
     dest: /etc/avahi/services/tipi.service
     group: avahi
-    user: avahi
+    owner: avahi
 
 - name: Start and enable avahi-daemon
   service:
     name: avahi-daemon
-    state: started
+    state: restarted
     enabled: yes
 ###

+ 0 - 2
ansible/templates/avahi/tipi.service

@@ -1,6 +1,5 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
-
 <service-group>
   <name replace-wildcards="yes">%h</name>
   <service>
@@ -8,7 +7,6 @@
     <port>80</port>
   </service>
 </service-group>
-
 <service-group>
   <name replace-wildcards="yes">%h</name>
   <service>