From: Fatih Degirmenci Date: Mon, 18 May 2020 09:52:01 +0000 (+0000) Subject: Bootstrap provisioners and installers if they are defined X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=fec2c753d449ab2b4d66dcacdd1b578eb5c9b3b3;p=infra%2Fstack%2Fkubernetes.git Bootstrap provisioners and installers if they are defined Change-Id: I97ba967dcf3284aec1eafdad781d5bffdba1ee79 --- diff --git a/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml b/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml index 55e3e6c..a2d2902 100644 --- a/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml +++ b/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml @@ -25,18 +25,20 @@ - "{{ engine_workspace }}/offline/git/engine/engine/provisioner" - "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" -- name: Clone engine provisioner repository - git: - repo: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}" - dest: "{{ engine_workspace }}/offline/git/engine/engine/provisioner" - version: "{{ provisioners[provisioner_type].version }}" - force: true +- block: + - name: Clone engine provisioner repository + git: + repo: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}" + dest: "{{ engine_workspace }}/offline/git/engine/engine/provisioner" + version: "{{ provisioners[provisioner_type].version }}" + force: true -- name: Copy engine provisioner vars file into group_vars - copy: - src: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}/vars/{{ provisioner_type }}.yaml" - dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" - force: true + - name: Copy engine provisioner vars file into group_vars + copy: + src: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}/vars/{{ provisioner_type }}.yaml" + dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" + force: true + when: provisioners is defined - name: Delete outdated engine installer vars files from group_vars file: @@ -46,17 +48,19 @@ - "{{ engine_workspace }}/offline/git/engine/engine/installer" - "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ installer_type }}.yaml" -- name: Clone engine installer repository - git: - repo: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}" - dest: "{{ engine_workspace }}/offline/git/engine/engine/installer" - version: "{{ installers[installer_type].version }}" - force: true +- block: + - name: Clone engine installer repository + git: + repo: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}" + dest: "{{ engine_workspace }}/offline/git/engine/engine/installer" + version: "{{ installers[installer_type].version }}" + force: true -- name: Copy engine installer vars file into group_vars - copy: - src: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}/vars/{{ installer_type }}.yaml" - dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ installer_type }}.yaml" - force: true + - name: Copy engine installer vars file into group_vars + copy: + src: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}/vars/{{ installer_type }}.yaml" + dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ installer_type }}.yaml" + force: true + when: installers is defined # vim: set ts=2 sw=2 expandtab: diff --git a/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml b/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml index f45182d..8641fb4 100644 --- a/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml +++ b/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml @@ -25,23 +25,25 @@ - "{{ engine_path }}/engine/provisioner" - "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" -- name: Clone engine provisioner repository - git: - repo: "{{ provisioners[provisioner_type].src }}" - dest: "{{ engine_path }}/engine/provisioner" - version: "{{ provisioners[provisioner_type].version }}" - refspec: "{{ provisioners[provisioner_type].refspec | default(omit) }}" - force: true - environment: - http_proxy: "{{ lookup('env','http_proxy') }}" - https_proxy: "{{ lookup('env','https_proxy') }}" - no_proxy: "{{ lookup('env','no_proxy') }}" +- block: + - name: Clone engine provisioner repository + git: + repo: "{{ provisioners[provisioner_type].src }}" + dest: "{{ engine_path }}/engine/provisioner" + version: "{{ provisioners[provisioner_type].version }}" + refspec: "{{ provisioners[provisioner_type].refspec | default(omit) }}" + force: true + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" -- name: Copy engine provisioner vars file into group_vars - copy: - src: "{{ engine_path }}/engine/provisioner/vars/{{ provisioner_type }}.yaml" - dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" - force: true + - name: Copy engine provisioner vars file into group_vars + copy: + src: "{{ engine_path }}/engine/provisioner/vars/{{ provisioner_type }}.yaml" + dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml" + force: true + when: provisioners is defined - name: Delete outdated engine installer files and folders file: @@ -51,22 +53,24 @@ - "{{ engine_path }}/engine/installer" - "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer_type }}.yaml" -- name: Clone engine installer repository - git: - repo: "{{ installers[installer_type].src }}" - dest: "{{ engine_path }}/engine/installer" - version: "{{ installers[installer_type].version }}" - refspec: "{{ installers[installer_type].refspec | default(omit) }}" - force: true - environment: - http_proxy: "{{ lookup('env','http_proxy') }}" - https_proxy: "{{ lookup('env','https_proxy') }}" - no_proxy: "{{ lookup('env','no_proxy') }}" +- block: + - name: Clone engine installer repository + git: + repo: "{{ installers[installer_type].src }}" + dest: "{{ engine_path }}/engine/installer" + version: "{{ installers[installer_type].version }}" + refspec: "{{ installers[installer_type].refspec | default(omit) }}" + force: true + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" -- name: Copy engine installer vars file into group_vars - copy: - src: "{{ engine_path }}/engine/installer/vars/{{ installer_type }}.yaml" - dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer_type }}.yaml" - force: true + - name: Copy engine installer vars file into group_vars + copy: + src: "{{ engine_path }}/engine/installer/vars/{{ installer_type }}.yaml" + dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer_type }}.yaml" + force: true + when: installers is defined # vim: set ts=2 sw=2 expandtab: diff --git a/playbooks/roles/package/tasks/prepare-packaging.yaml b/playbooks/roles/package/tasks/prepare-packaging.yaml index 48ceebc..fed23f8 100644 --- a/playbooks/roles/package/tasks/prepare-packaging.yaml +++ b/playbooks/roles/package/tasks/prepare-packaging.yaml @@ -23,53 +23,57 @@ state: directory register: tempdir -- name: Clone engine provisioner repositories - git: - repo: "{{ provisioners[provisioner.key].src }}" - dest: "{{ tempdir.path }}/{{ provisioner.key }}" - version: "{{ provisioners[provisioner.key].version }}" - refspec: "{{ provisioners[provisioner.key].refspec | default(omit) }}" - force: true - with_dict: "{{ provisioners }}" - loop_control: - loop_var: provisioner - environment: - http_proxy: "{{ lookup('env','http_proxy') }}" - https_proxy: "{{ lookup('env','https_proxy') }}" - no_proxy: "{{ lookup('env','no_proxy') }}" +- block: + - name: Clone engine provisioner repositories + git: + repo: "{{ provisioners[provisioner.key].src }}" + dest: "{{ tempdir.path }}/{{ provisioner.key }}" + version: "{{ provisioners[provisioner.key].version }}" + refspec: "{{ provisioners[provisioner.key].refspec | default(omit) }}" + force: true + with_dict: "{{ provisioners }}" + loop_control: + loop_var: provisioner + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" -- name: Copy engine provisioner vars file into group_vars - copy: - src: "{{ tempdir.path }}/{{ provisioner.key }}/vars/{{ provisioner.key }}.yaml" - dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner.key }}.yaml" - force: true - with_dict: "{{ provisioners }}" - loop_control: - loop_var: provisioner + - name: Copy engine provisioner vars file into group_vars + copy: + src: "{{ tempdir.path }}/{{ provisioner.key }}/vars/{{ provisioner.key }}.yaml" + dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner.key }}.yaml" + force: true + with_dict: "{{ provisioners }}" + loop_control: + loop_var: provisioner + when: provisioners is defined -- name: Clone engine installer repositories - git: - repo: "{{ installers[installer.key].src }}" - dest: "{{ tempdir.path }}/{{ installer.key }}" - version: "{{ installers[installer.key].version }}" - refspec: "{{ installers[installer.key].refspec | default(omit) }}" - force: true - with_dict: "{{ installers }}" - loop_control: - loop_var: installer - environment: - http_proxy: "{{ lookup('env','http_proxy') }}" - https_proxy: "{{ lookup('env','https_proxy') }}" - no_proxy: "{{ lookup('env','no_proxy') }}" +- block: + - name: Clone engine installer repositories + git: + repo: "{{ installers[installer.key].src }}" + dest: "{{ tempdir.path }}/{{ installer.key }}" + version: "{{ installers[installer.key].version }}" + refspec: "{{ installers[installer.key].refspec | default(omit) }}" + force: true + with_dict: "{{ installers }}" + loop_control: + loop_var: installer + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" -- name: Copy engine installer vars file into group_vars - copy: - src: "{{ tempdir.path }}/{{ installer.key }}/vars/{{ installer.key }}.yaml" - dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer.key }}.yaml" - force: true - with_dict: "{{ installers }}" - loop_control: - loop_var: installer + - name: Copy engine installer vars file into group_vars + copy: + src: "{{ tempdir.path }}/{{ installer.key }}/vars/{{ installer.key }}.yaml" + dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer.key }}.yaml" + force: true + with_dict: "{{ installers }}" + loop_control: + loop_var: installer + when: installers is defined - name: Delete temporary folder file: