ansible-role-tripleo-modify.../tasks/yum_update.yml

58 lines
1.4 KiB
YAML

- import_tasks: precheck.yml
tags:
- always
- name: Inspect image
docker_image_facts:
name: "{{ source_image }}"
register: source_image_facts
- name: Set original_user
set_fact:
original_user: "{{ source_image_facts.images[0].Config.User }}"
- name: Create image build context directory
tempfile:
state: directory
prefix: tripleo-modify-image
register: context_dir
- name: Copy directory used for /etc/yum.repos.d
copy:
src: "{{ yum_repos_dir_path }}"
dest: "{{ context_dir.path }}/yum.repos.d"
when: yum_repos_dir_path is defined
- name: Generate host package json file
block:
- command: |
rpm -qa --qf '"%{NAME}": "%{VERSION}-%{RELEASE}"\n'
register: rpm_query_output
- copy:
content: "{{ rpm_query_output.stdout | from_yaml | to_nice_json }}"
dest: "{{ context_dir.path }}/host_packages.json"
when: compare_host_packages
- name: Write Dockerfile to {{ context_dir.path }}
template:
src: Dockerfile.j2
dest: "{{ context_dir.path }}/Dockerfile"
- name: Write yum_update.sh
copy:
src: yum_update.sh
dest: "{{ context_dir.path }}/yum_update.sh"
mode: '0555'
- name: Write compare-package-json.py
copy:
src: compare-package-json.py
dest: "{{ context_dir.path }}/compare-package-json.py"
mode: '0555'
- name: Modify image
import_tasks: modify_image.yml