diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca4a5c5..44211e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,3 +59,8 @@ ansible-k3s-dev: k3s_token: $dev_k3s_token rules: - if: '$SCRIPT == "k3s" && $ENVIRONMENT_NAME == "dev"' + artifacts: + paths: + - config + expire_in: 1 days + when: always \ No newline at end of file diff --git a/ansible/roles/k3s/post/tasks/main.yml b/ansible/roles/k3s/post/tasks/main.yml index 8ab5a0d..b4e4627 100644 --- a/ansible/roles/k3s/post/tasks/main.yml +++ b/ansible/roles/k3s/post/tasks/main.yml @@ -1,6 +1,6 @@ - name: ansible copy file from remote to local. fetch: src: /home/administrator/.kube/config - dest: "/drop/config-{{ lookup('env','ENVIRONMENT_NAME') }}" + dest: "./" flat: yes - when: ansible_hostname == hostvars[groups['master'][0]]['ansible_hostname'] + when: ansible_hostname == groups[master_group][0]