浏览代码

[hauk] Update to php82 and fix role

Colin Powell 2 年之前
父节点
当前提交
f6d59181d1

+ 1 - 1
lab/ansible/hosts

@@ -12,7 +12,7 @@ emus0.local
 excalidraw1.local
 fifttrackee0.local
 gogs1.local
-hawk1.local
+hauk0.local
 icecast0.local
 jellyfin1.local
 kibana1.local

+ 1 - 0
lab/ansible/playbook.yml

@@ -71,6 +71,7 @@
 - hosts: geoloc
   roles:
     - role: nginx
+    - role: memcached
     - role: hauk
 
 - hosts: podcasts

+ 8 - 3
lab/ansible/roles/hauk/tasks/main.yml

@@ -1,7 +1,7 @@
 ---
 - name: Dependencies installed
   community.general.pkgng:
-    name: git-tiny,php80,php80-openssl,php80-pecl-memcached,php80-pecl-redis,php80-ldap,php80-filter,php80-session
+    name: git-tiny,php82,php82-pecl-memcached,php82-pecl-redis,php82-ldap,php82-filter,php82-session,py39-pexpect
     state: latest
 
 - name: PHP-fpm enabled
@@ -30,9 +30,14 @@
     path: /usr/local/etc/hauk/config.php
 
 - name: Hauk installed
-  shell:
-    cmd: "./install.sh -f -c /usr/local/www/hauk"
+  expect:
+    command: "./install.sh -f -c /usr/local/www/hauk"
     chdir: /usr/local/src/hauk
+    responses:
+      Question:
+      'Config file already exists! Overwrite? [y/N]:' : 'n'
+      'Do you wish to open this file for editing now? [Y/n]: ' : 'n'
+  ignore_errors: true
 
 - name: Nginx location file installed
   ansible.builtin.copy:

+ 5 - 0
lab/ansible/roles/memcached/handlers/main.yml

@@ -0,0 +1,5 @@
+---
+- name: Memcachedrestarted
+  service:
+    name: memcached
+    state: restarted

+ 13 - 0
lab/ansible/roles/memcached/tasks/main.yml

@@ -0,0 +1,13 @@
+---
+- name: Dependencies installed
+  community.general.pkgng:
+    name: memcached
+    state: latest
+
+- name: Memcached enabled
+  shell: sysrc memcached_enable="YES"
+
+- name: Ensure memcached is running
+  service:
+    name: memcached
+    state: started

+ 1 - 1
lab/ansible/roles/unbound/files/service.zones

@@ -30,7 +30,7 @@ local-data: "paperless.service  IN      A       192.168.1.167"
 local-data: "tor.service        IN      A       192.168.1.127"
 local-data: "db.service         IN      A       192.168.1.107"
 local-data: "timelapse.service  IN      A       192.168.1.99"
-local-data: "hauk.service       IN      A       192.168.1.122"
+local-data: "hauk.service       IN      A       192.168.1.119"
 local-data: "tandoor.service    IN      A       192.168.1.108"
 local-data: "kibana.service     IN      A       192.168.1.226"
 local-data: "elastic.service    IN      A       192.168.1.199"