Skip to content
Snippets Groups Projects
Commit 86846048 authored by Nathan Rodet's avatar Nathan Rodet
Browse files

added image to ansible job instead of installing it

parent 19143d35
No related branches found
No related tags found
No related merge requests found
Pipeline #79656 failed
......@@ -12,14 +12,6 @@ variables:
TF_CACHE_KEY: default
before_script:
- apk add --no-cache python3 py3-pip
- python3 -m venv .venv
- git clone https://github.com/ansible/ansible.git
- cd ansible
- virtualenv venv
- source venv/bin/activate
- pip install .
- which ansible
- ssh-keygen -b 2048 -t rsa -C "${ENVIRONMENT}-cma-update-tmp" -f ${SSH_KEY_PATH} -q -N ""
- cd ${TF_ROOT}
- export TF_VAR_SCW_ACCESS_KEY=${TF_VAR_SCW_ACCESS_KEY}
......@@ -34,7 +26,6 @@ stages:
- build
- plan
- deploy
- configure
- destroy
ansible-hosts-file:
......@@ -44,12 +35,12 @@ ansible-hosts-file:
- . ${SCRIPTS_ROOT}/build-ansible-hosts.sh
- echo $(ansible --version)
init:
tf-init:
stage: prepare
script:
- gitlab-terraform init
validate:
tf-validate:
stage: prepare
script:
- gitlab-terraform validate
......@@ -75,8 +66,10 @@ tf-apply:
dependencies:
- tf-plan
ansible:
stage: configuration
ansible-playbooks:
image:
name: registry.gitlab.com/torese/docker-ansible
stage: deploy
script:
- ansible-playbook -i ${ANSIBLE_ROOT}/hosts.yaml ${ANSIBLE_ROOT}/tasks/update.yaml --private-key ${SSH_KEY_PATH}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment