From 0a479039e21977be6dd1cd8d94e23d9845114941 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Mon, 25 Sep 2023 21:48:29 +0100 Subject: [PATCH] separate playbooks --- infra/cloud/0001_initialise_playbook.yaml | 18 ++++++++ infra/cloud/0001_software_playbook.yaml | 53 ----------------------- infra/cloud/0002_software_playbook.yaml | 40 +++++++++++++++++ 3 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 infra/cloud/0001_initialise_playbook.yaml delete mode 100644 infra/cloud/0001_software_playbook.yaml create mode 100644 infra/cloud/0002_software_playbook.yaml diff --git a/infra/cloud/0001_initialise_playbook.yaml b/infra/cloud/0001_initialise_playbook.yaml new file mode 100644 index 0000000..5ece9eb --- /dev/null +++ b/infra/cloud/0001_initialise_playbook.yaml @@ -0,0 +1,18 @@ +- name: Initialise VM + hosts: cloud + gather_facts: false + tasks: + - name: Wait for connection + ansible.builtin.wait_for_connection: + timeout: 300 + - name: Install system packages + ansible.builtin.apt: + package: qemu-guest-agent + state: latest + become: true + - name: Enable qemu-guest-agent + ansible.builtin.systemd: + name: qemu-guest-agent + state: started + enabled: true + become: true diff --git a/infra/cloud/0001_software_playbook.yaml b/infra/cloud/0001_software_playbook.yaml deleted file mode 100644 index 0c96915..0000000 --- a/infra/cloud/0001_software_playbook.yaml +++ /dev/null @@ -1,53 +0,0 @@ -- name: Setup Software - hosts: cloud - gather_facts: false - tasks: - - name: Wait for connection - ansible.builtin.wait_for_connection: - timeout: 300 - - name: Install system packages - ansible.builtin.apt: - package: qemu-guest-agent - state: latest - become: true - - name: Install docker - block: - - name: Install dependencies - ansible.builtin.apt: - package: - - curl - - python3-apt - - gpg - state: latest - become: true - - name: Add key - ansible.builtin.apt_key: - url: https://download.docker.com/linux/debian/gpg - become: true - - name: Add repo - ansible.builtin.apt_repository: - update_cache: true - repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable - become: true - - name: Install docker - ansible.builtin.apt: - pacakge: - - docker-ce - - docker-ce-cli - - containerd.io - - docker-buildx-plugin - - docker-compose-plugin - state: latest - become: true - - name: Enable docker - ansible.builtin.systemd: - name: docker - state: started - enabled: true - become: true - - name: Enable qemu-guest-agent - ansible.builtin.systemd: - name: qemu-guest-agent - state: started - enabled: true - become: true diff --git a/infra/cloud/0002_software_playbook.yaml b/infra/cloud/0002_software_playbook.yaml new file mode 100644 index 0000000..8849650 --- /dev/null +++ b/infra/cloud/0002_software_playbook.yaml @@ -0,0 +1,40 @@ +- name: Install software + hosts: cloud + gather_facts: false + tasks: + - name: Wait for connection + ansible.builtin.wait_for_connection: + timeout: 300 + - name: Install dependencies + ansible.builtin.apt: + package: + - curl + - python3-apt + - gpg + state: latest + become: true + - name: Add docker key + ansible.builtin.apt_key: + url: https://download.docker.com/linux/debian/gpg + become: true + - name: Add docker repo + ansible.builtin.apt_repository: + update_cache: true + repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable + become: true + - name: Install docker + ansible.builtin.apt: + pacakge: + - docker-ce + - docker-ce-cli + - containerd.io + - docker-buildx-plugin + - docker-compose-plugin + state: latest + become: true + - name: Enable docker + ansible.builtin.systemd: + name: docker + state: started + enabled: true + become: true \ No newline at end of file