diff --git a/roles/drone-ci/handlers/main.yml b/roles/drone-ci/handlers/main.yml new file mode 100644 index 00000000..991c4bcc --- /dev/null +++ b/roles/drone-ci/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: Restart gitea + community.docker.docker_container: + name: gitea + image: gitea/gitea:latest + state: started + restart: true + listen: "restart gitea" diff --git a/roles/drone-ci/molecule/default/molecule.yml b/roles/drone-ci/molecule/default/molecule.yml index 0671311d..6e293974 100644 --- a/roles/drone-ci/molecule/default/molecule.yml +++ b/roles/drone-ci/molecule/default/molecule.yml @@ -8,3 +8,6 @@ provisioner: drone_ci_gitea_client_secret: asdfasd12341234 gitea_port_http: 3001 ansible_nas_hostname: ansible-nas-ci + gitea_data_directory: "/tmp" + playbooks: + prepare: prepare.yml diff --git a/roles/drone-ci/molecule/default/prepare.yml b/roles/drone-ci/molecule/default/prepare.yml new file mode 100644 index 00000000..343f1e6f --- /dev/null +++ b/roles/drone-ci/molecule/default/prepare.yml @@ -0,0 +1,20 @@ +--- +- name: Prepare + hosts: all + tasks: + - name: Install docker python module + pip: + name: docker + + - name: Create a dummy gitea config directory + file: + path: "{{ item }}" + state: directory + recurse: yes + with_items: + - "{{ gitea_data_directory }}/gitea/gitea/conf" + + - name: Create a dummy gitea config file + file: + path: "{{ gitea_data_directory }}/gitea/gitea/conf/app.ini" + state: touch