]> git.ekhem.eu.org Git - turnup.git/commitdiff
Install /etc/ansible/hosts before executing other playbooks.
authorJakub Czajka <jakub@ekhem.eu.org>
Mon, 4 Dec 2023 09:46:37 +0000 (10:46 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
install/ansible.yaml [new file with mode: 0644]
install/download.yaml
turnup.yaml

diff --git a/install/ansible.yaml b/install/ansible.yaml
new file mode 100644 (file)
index 0000000..11296a2
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- name: Install ansible and git
+  package:
+    name:
+      - ansible
+      - git
+  become: true
+- name: Create ansible directory
+  file:
+    path: /etc/ansible
+    state: directory
+  become: true
+- name: Checkout hosts to /etc/ansible
+  command: /usr/bin/git --work-tree=/etc --git-dir=/srv/git/server.git checkout \
+    main --force ansible/hosts
+  become: true
index 8a3955abbe82a7cf808f95c8cad752c56df6ccfb..1496e999a3b9fc2119fa5b2cb8f18f9c592b55f4 100644 (file)
@@ -1,6 +1,11 @@
 # Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
 # License: GPL-3.0 or later.
 
+- name: Install pip
+  package:
+    name:
+      - python3-pip
+  become: true
 - name: Install gdrive_knife
   pip:
     name: gdrive_knife
index e27d9979e03c6e0be39c968612d86e3fc8ea8ca3..aca6bdd188729f7edee7d627dc6c1a6a75125a15 100644 (file)
         users:
           - git
           - "{{ default_user }}"
-    - name: Install ansible and pip
-      package:
-        name:
-          - ansible
-          - python3-pip
-      become: true
     - include_tasks: install/download.yaml
       with_items: "{{ inputs }}"
     - include_tasks: install/certify.yaml
       with_items: "{{ certificates }}"
+    - include_tasks: install/ansible.yaml
     - include_tasks: install/environment.yaml
     - include_tasks: install/database.yaml