summaryrefslogtreecommitdiff
path: root/roles/openwrt/image/tasks/main.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-12-06 19:21:12 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-12-06 19:21:12 +0100
commita64c677e603dd3f6fdb57d89b65ccc5cd967e20c (patch)
tree6415424d024d21212f1a896538eca44fe7efa5a8 /roles/openwrt/image/tasks/main.yml
parentcleanup ch-testvm* and make common playbook work in any case (diff)
upgrade accesspoints
Diffstat (limited to 'roles/openwrt/image/tasks/main.yml')
-rw-r--r--roles/openwrt/image/tasks/main.yml101
1 files changed, 51 insertions, 50 deletions
diff --git a/roles/openwrt/image/tasks/main.yml b/roles/openwrt/image/tasks/main.yml
index 5a3f332b..82a1c50d 100644
--- a/roles/openwrt/image/tasks/main.yml
+++ b/roles/openwrt/image/tasks/main.yml
@@ -3,55 +3,56 @@
run_once: true
when: openwrt_imgbuilder_tarball is not defined
-- block:
- - include: prepare.yml
-
- - name: Create the output directory for built images
- file:
- path: "{{ openwrt_output_dir }}"
- state: directory
-
- - name: generate list of packages to add or remove
- set_fact:
- openwrt_packages: >-
- {{ openwrt_packages_remove | map('regex_replace', '^', '-') | join(' ') }}
- {{ openwrt_packages_add | join(' ') }}
- {{ openwrt_packages_extra | join(' ') }}
-
- - name: Build the OpenWrt image
- command: >-
- make -C {{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }} image
- {% if openwrt_profile is defined %}PROFILE="{{ openwrt_profile }}" {% endif %}
- FILES="{{ openwrt_imgbuilder_files }}"
- PACKAGES="{{ openwrt_packages }}"
- {% if openwrt_extra_name is defined %} EXTRA_IMAGE_NAME="{{ openwrt_extra_name }}" {% endif %}
- register: openwrt_build
-
- - name: Copy newly built OpenWrt image
- loop: "{{ openwrt_output_image_suffixes }}"
- copy:
- src: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/bin/targets/{{ openwrt_arch }}/{{ openwrt_target }}/{{ openwrt_output_image_name_base }}-{{ item }}"
- dest: "{{ openwrt_output_dir }}"
-
- ## TODO: make this less ugly..
- - name: set output image names
- set_fact:
- openwrt_output_images: "{{ '[\"' + openwrt_output_dir + '/' + openwrt_output_image_name_base + '-' + (openwrt_output_image_suffixes | join('\", \"' + openwrt_output_dir + '/' + openwrt_output_image_name_base + '-')) + '\"]' }}"
+- name: build the image
+ block:
+ - include: prepare.yml
+
+ - name: Create the output directory for built images
+ file:
+ path: "{{ openwrt_output_dir }}"
+ state: directory
+
+ - name: generate list of packages to add or remove
+ set_fact:
+ openwrt_packages: >-
+ {{ openwrt_packages_remove | map('regex_replace', '^', '-') | join(' ') }}
+ {{ openwrt_packages_add | join(' ') }}
+ {{ openwrt_packages_extra | join(' ') }}
+
+ - name: Build the OpenWrt image
+ command: >-
+ make -C {{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }} image
+ {% if openwrt_profile is defined %}PROFILE="{{ openwrt_profile }}" {% endif %}
+ FILES="{{ openwrt_imgbuilder_files }}"
+ PACKAGES="{{ openwrt_packages }}"
+ {% if openwrt_extra_name is defined %} EXTRA_IMAGE_NAME="{{ openwrt_extra_name }}" {% endif %}
+ register: openwrt_build
+
+ - name: Copy newly built OpenWrt image
+ loop: "{{ openwrt_output_image_suffixes }}"
+ copy:
+ src: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/bin/targets/{{ openwrt_arch }}/{{ openwrt_target }}/{{ openwrt_output_image_name_base }}-{{ item }}"
+ dest: "{{ openwrt_output_dir }}"
+
+ ## TODO: make this less ugly..
+ - name: set output image names
+ set_fact:
+ openwrt_output_images: "{{ '[\"' + openwrt_output_dir + '/' + openwrt_output_image_name_base + '-' + (openwrt_output_image_suffixes | join('\", \"' + openwrt_output_dir + '/' + openwrt_output_image_name_base + '-')) + '\"]' }}"
always:
- - name: save stdout build-log to output directory
- when: openwrt_build is defined
- copy:
- content: "{{ openwrt_build.stdout }}\n"
- dest: "{{ openwrt_output_dir }}/build-stdout.log"
-
- - name: save stderr build-log to output directory
- when: openwrt_build is defined
- copy:
- content: "{{ openwrt_build.stderr }}\n"
- dest: "{{ openwrt_output_dir }}/build-stderr.log"
-
- - name: Delete the temporary build directory
- file:
- path: "{{ openwrt_imgbuilder_dir }}"
- state: absent
+ - name: save stdout build-log to output directory
+ when: openwrt_build is defined
+ copy:
+ content: "{{ openwrt_build.stdout }}\n"
+ dest: "{{ openwrt_output_dir }}/build-stdout.log"
+
+ - name: save stderr build-log to output directory
+ when: openwrt_build is defined
+ copy:
+ content: "{{ openwrt_build.stderr }}\n"
+ dest: "{{ openwrt_output_dir }}/build-stderr.log"
+
+ - name: Delete the temporary build directory
+ file:
+ path: "{{ openwrt_imgbuilder_dir }}"
+ state: absent