diff --git a/roles/requirements.yml b/roles/requirements.yml index 4b4083a..562080d 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -3,3 +3,6 @@ src : ssh://git@git.scimetis.net:2222/yohan/role_setup_volume.git scm: git +- name : role_build_container_image + src : ssh://git@git.scimetis.net:2222/yohan/role_build_container_image.git + scm: git diff --git a/roles/role_deploy_SemanticScuttle/tasks/build_image.yml b/roles/role_deploy_SemanticScuttle/tasks/build_image.yml deleted file mode 100644 index 1166b90..0000000 --- a/roles/role_deploy_SemanticScuttle/tasks/build_image.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: Get {{ item.repo_name }} repo's last commit - ansible.builtin.git: - repo: "{{ item.repo_url }}" - clone: no - update: no - version: master - register: git - changed_when: false - -- name: Set fact commit - set_fact: - commit: "{{ git.after[0:10] }}" - -- name: Build {{ item.image_name }} image - containers.podman.podman_image: - name: "{{ item.image_name }}" - path: "{{ item.repo_url }}" - force: true - build: - force_rm: true - annotation: - git_commit: "{{ commit }}" - become: true - register: result - -- name: Set fact {{ item.result_var }} - set_fact: - "{{ item.result_var }}": "{{ result }}" diff --git a/roles/role_deploy_SemanticScuttle/tasks/main.yml b/roles/role_deploy_SemanticScuttle/tasks/main.yml index 1f615e8..6f85197 100644 --- a/roles/role_deploy_SemanticScuttle/tasks/main.yml +++ b/roles/role_deploy_SemanticScuttle/tasks/main.yml @@ -78,12 +78,15 @@ - scuttle_php5-fpm_conf when: not scuttle_installed_flag.stat.exists -- name: Include build_image.yml - ansible.builtin.include_tasks: "tasks/build_image.yml" +- name: Build image + ansible.builtin.include_role: + name: role_build_container_image + vars: + image: "{{ item }}" with_items: - repo_url: "https://git.{{ DOMAIN }}/yohan/docker-apache-for-fpm.git" repo_name: docker-apache-for-fpm - image_name: apache-scuttle + name: apache-scuttle result_var: apache_scuttle_result - name: Create apache-scuttle container