From 1e655103b2ad21bc5f33844de635e594b8d0f610 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Mon, 4 Dec 2023 10:46:37 +0100 Subject: [PATCH] Install /etc/ansible/hosts before executing other playbooks. --- install/ansible.yaml | 18 ++++++++++++++++++ install/download.yaml | 5 +++++ turnup.yaml | 7 +------ 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 install/ansible.yaml diff --git a/install/ansible.yaml b/install/ansible.yaml new file mode 100644 index 0000000..11296a2 --- /dev/null +++ b/install/ansible.yaml @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Jakub Czajka +# 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 diff --git a/install/download.yaml b/install/download.yaml index 8a3955a..1496e99 100644 --- a/install/download.yaml +++ b/install/download.yaml @@ -1,6 +1,11 @@ # Copyright (c) 2023 Jakub Czajka # License: GPL-3.0 or later. +- name: Install pip + package: + name: + - python3-pip + become: true - name: Install gdrive_knife pip: name: gdrive_knife diff --git a/turnup.yaml b/turnup.yaml index e27d997..aca6bdd 100644 --- a/turnup.yaml +++ b/turnup.yaml @@ -12,16 +12,11 @@ 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 -- 2.39.5