From bdedbd2873201c886be78d81a1c2492711fe237a Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Fri, 4 Apr 2025 19:34:31 +0200 Subject: ansible: deploy gitea using ansible (w.i.p.) --- ansible/roles/gitea/tasks/deploy_gitea.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ansible/roles/gitea/tasks/deploy_gitea.yml (limited to 'ansible/roles/gitea/tasks/deploy_gitea.yml') diff --git a/ansible/roles/gitea/tasks/deploy_gitea.yml b/ansible/roles/gitea/tasks/deploy_gitea.yml new file mode 100644 index 0000000..4390689 --- /dev/null +++ b/ansible/roles/gitea/tasks/deploy_gitea.yml @@ -0,0 +1,38 @@ +--- +- name: Gather the package facts + ansible.builtin.package_facts: + manager: auto + +- name: Verify Docker and compose are available + ansible.builtin.assert: + that: + - "'docker-ce' in ansible_facts.packages" + - "'docker-compose-plugin' in ansible_facts.packages" + fail_msg: "Docker and compose plugin are not installed" + +- name: Create Gitea directories + ansible.builtin.file: + path: "{{ gitea_root_dir }}" + state: directory + mode: '0755' + +- name: Deploy Gitea stack using compose v2 + community.docker.docker_compose_v2: + project_src: "{{ playbook_dir }}/../../docker/compose/gitea" + state: present + pull: "policy" + recreate: always + +- name: Verify that gitea and db services are running + ansible.builtin.assert: + that: + - gitea_container.State == 'running' + - db_container.State == 'running' + vars: + gitea_container: >- + {{ output.containers | selectattr("Service", "equalto", "gitea") | first }} + db_container: >- + {{ output.containers | selectattr("Service", "equalto", "db") | first }} + + +... -- cgit v1.2.3