Bootstrap provisioners and installers if they are defined 92/4792/1
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 18 May 2020 09:52:01 +0000 (09:52 +0000)
committerFatih Degirmenci <fdegir@gmail.com>
Mon, 18 May 2020 09:58:50 +0000 (09:58 +0000)
Change-Id: I97ba967dcf3284aec1eafdad781d5bffdba1ee79

playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml
playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml
playbooks/roles/package/tasks/prepare-packaging.yaml

index 55e3e6cfa6f8637908f9160092745010a1f548de..a2d2902e6d733275afe9836e0f56354238a86787 100644 (file)
     - "{{ 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:
     - "{{ 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:
index f45182db320f8e1d77bc11e8a2e05ce39bd9c582..8641fb454337ccd4c2745d643096bff5f9a8a82a 100644 (file)
     - "{{ 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:
     - "{{ 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:
index 48ceebc944569db25303d2fee5c89b6ec22d28f3..fed23f805be2e8ed665efcba3563e1ee0a747c84 100644 (file)
     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: