From 1ddc0c0d854f802123577e97fdc4571e5a5a1fc7 Mon Sep 17 00:00:00 2001 From: Maarten de Waard <maarten@greenhost.nl> Date: Fri, 28 Jun 2019 11:52:47 +0200 Subject: [PATCH] fetch cluster related files to cluster_data directory --- .gitignore | 3 +-- ansible/group_vars/all/oas.yml | 10 +++++----- ansible/roles/setup/tasks/rke.yml | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index d68d78c14..c2ea86a02 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ # Ignore files created by ansible-playbook *.retry -/ansible/secrets/ /ansible/rke.log /ansible/cluster_data/ test/rke.log @@ -18,10 +17,10 @@ test/rke.log # Ignore files created during CI using test/ci-bootstrap.py /test/group_vars/all/ -/test/secrets/ /test/inventory.yml /test/behave/behave.ini /test/behave/rerun_failing.features +/ansible/cluster_data/ # Ignore files created during tests /test/behave/**/screenshots/ diff --git a/ansible/group_vars/all/oas.yml b/ansible/group_vars/all/oas.yml index a4ba91e62..a4c3368aa 100644 --- a/ansible/group_vars/all/oas.yml +++ b/ansible/group_vars/all/oas.yml @@ -7,11 +7,11 @@ ansible_python_interpreter: "/usr/bin/env python3" # Nextcloud administrator password. If you do not change this value, it gets # generated and stored in `secrets/nextcloud_admin_password`. You can also choose # your own password and fill it in here instead. -nextcloud_password: "{{ lookup('password', './secrets/nextcloud_admin_password chars=ascii_letters') }}" -nextcloud_mariadb_password: "{{ lookup('password', './secrets/nextcloud_mariadb_password chars=ascii_letters') }}" -nextcloud_mariadb_root_password: "{{ lookup('password', './secrets/nextcloud_mariadb_root_password chars=ascii_letters') }}" -collabora_password: "{{ lookup('password', './secrets/collabora_admin_password chars=ascii_letters') }}" -grafana_admin_password: "{{ lookup('password', './secrets/grafana_admin_password chars=ascii_letters') }}" +nextcloud_password: "{{ lookup('password', './cluster_data/secrets/nextcloud_admin_password chars=ascii_letters') }}" +nextcloud_mariadb_password: "{{ lookup('password', './cluster_data/secrets/nextcloud_mariadb_password chars=ascii_letters') }}" +nextcloud_mariadb_root_password: "{{ lookup('password', './cluster_data/secrets/nextcloud_mariadb_root_password chars=ascii_letters') }}" +collabora_password: "{{ lookup('password', './cluster_data/secrets/collabora_admin_password chars=ascii_letters') }}" +grafana_admin_password: "{{ lookup('password', './cluster_data/secrets/grafana_admin_password chars=ascii_letters') }}" # git repo versions git_helmfiles_version: '6c5b62376e8ca8cd8789ece716e91ad0693e6f9f' diff --git a/ansible/roles/setup/tasks/rke.yml b/ansible/roles/setup/tasks/rke.yml index e822ba0a1..287ead2a1 100644 --- a/ansible/roles/setup/tasks/rke.yml +++ b/ansible/roles/setup/tasks/rke.yml @@ -4,15 +4,6 @@ - rke shell: /usr/local/bin/rke up --config=/oas/control/local/rke/cluster.yml >> /oas/logs/rke.log -- name: Fetch /oas/logs/rke.log from cluster - tags: - - log - - rke - fetch: - src: /oas/logs/rke.log - dest: ./rke.log - flat: yes - - name: Ensure /root/.kube directory tags: - rke @@ -30,10 +21,19 @@ src: /oas/control/local/rke/kube_config_cluster.yml dest: /root/.kube/config -- name: Copy kubectl config to local host +- name: Copy cluster information to local folder tags: + - fetch + - rke - kubectl fetch: - src: /oas/control/local/rke/kube_config_cluster.yml - dest: cluster_data/kubectl.cfg + src: "{{ item.src }}" + dest: cluster_data/{{ item.dest }} flat: yes + loop: + - src: /oas/control/local/rke/kube_config_cluster.yml + dest: kube_config_cluster.yml + - src: /oas/logs/rke.log + dest: rke.log + - src: /oas/control/local/rke/cluster.yml + dest: rke_cluster.yml -- GitLab