Browse Source
For FFU, leapp tool requires the /etc/default/grub file to have entries to start with "GRUB". upgrade_steps for ffu has been updated to fix it for FFU. Align the args with the same name for the fresh deployment too. Related-Bug: #1890769 Change-Id: I2349f30d2159e068ebdb453372050459b7a78c65changes/17/746917/2
8 changed files with 209 additions and 7 deletions
@ -0,0 +1,37 @@
|
||||
# Molecule managed |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
{% if item.registry is defined %} |
||||
FROM {{ item.registry.url }}/{{ item.image }} |
||||
{% else %} |
||||
FROM {{ item.image }} |
||||
{% endif %} |
||||
|
||||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ |
||||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install sudo python*-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \ |
||||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ |
||||
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \ |
||||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \ |
||||
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi |
||||
|
||||
{% for pkg in item.easy_install | default([]) %} |
||||
# install pip for centos where there is no python-pip rpm in default repos |
||||
RUN easy_install {{ pkg }} |
||||
{% endfor %} |
||||
|
||||
|
||||
CMD ["sh", "-c", "while true; do sleep 10000; done"] |
@ -0,0 +1,39 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
- name: Converge |
||||
hosts: all |
||||
become: true |
||||
vars: |
||||
tripleo_kernel_args: "test=1" |
||||
tasks: |
||||
- name: create kernelargs entry with the older name |
||||
lineinfile: |
||||
dest: /etc/default/grub |
||||
regexp: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*' |
||||
insertafter: '^GRUB_CMDLINE_LINUX.*' |
||||
line: 'TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS=" {{ tripleo_kernel_args }} "' |
||||
- name: create append entry with older name |
||||
lineinfile: |
||||
dest: /etc/default/grub |
||||
line: 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX:+$GRUB_CMDLINE_LINUX }${TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS}"' |
||||
insertafter: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*' |
||||
- include_role: |
||||
name: "tripleo_kernel" |
||||
tasks_from: kernelargs.yml |
||||
vars: |
||||
tripleo_kernel_defer_reboot: true |
@ -0,0 +1,49 @@
|
||||
--- |
||||
driver: |
||||
name: delegated |
||||
options: |
||||
managed: false |
||||
login_cmd_template: >- |
||||
ssh |
||||
-o UserKnownHostsFile=/dev/null |
||||
-o StrictHostKeyChecking=no |
||||
-o Compression=no |
||||
-o TCPKeepAlive=yes |
||||
-o VerifyHostKeyDNS=no |
||||
-o ForwardX11=no |
||||
-o ForwardAgent=no |
||||
{instance} |
||||
ansible_connection_options: |
||||
ansible_connection: ssh |
||||
|
||||
log: true |
||||
|
||||
platforms: |
||||
- name: instance |
||||
|
||||
provisioner: |
||||
name: ansible |
||||
config_options: |
||||
defaults: |
||||
fact_caching: jsonfile |
||||
fact_caching_connection: /tmp/molecule/facts |
||||
inventory: |
||||
hosts: |
||||
all: |
||||
hosts: |
||||
instance: |
||||
ansible_host: localhost |
||||
log: true |
||||
env: |
||||
ANSIBLE_STDOUT_CALLBACK: yaml |
||||
ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" |
||||
|
||||
scenario: |
||||
test_sequence: |
||||
- prepare |
||||
- converge |
||||
- check |
||||
- verify |
||||
|
||||
verifier: |
||||
name: ansible |
@ -0,0 +1,21 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
- name: Prepare |
||||
hosts: all |
||||
roles: |
||||
- role: test_deps |
@ -0,0 +1,46 @@
|
||||
--- |
||||
# Copyright 2019 Red Hat, Inc. |
||||
# All Rights Reserved. |
||||
# |
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
||||
# not use this file except in compliance with the License. You may obtain |
||||
# a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
# License for the specific language governing permissions and limitations |
||||
# under the License. |
||||
|
||||
|
||||
- name: Verify |
||||
hosts: all |
||||
become: true |
||||
gather_facts: false |
||||
tasks: |
||||
- name: Check if the kernel args is applied to the grub file |
||||
lineinfile: |
||||
path: /etc/default/grub |
||||
line: 'GRUB_TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS=" test=1 "' |
||||
state: present |
||||
check_mode: true |
||||
register: grub |
||||
failed_when: (grub is changed) or (grub is failed) |
||||
- name: Check if the older name entries are removed |
||||
lineinfile: |
||||
path: /etc/default/grub |
||||
regexp: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*' |
||||
state: absent |
||||
check_mode: true |
||||
register: grub |
||||
failed_when: (grub is changed) or (grub is failed) |
||||
- name: Check if the older name entries are removed for append |
||||
lineinfile: |
||||
path: /etc/default/grub |
||||
regexp: '.*{TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS}.*' |
||||
state: absent |
||||
check_mode: true |
||||
register: grub |
||||
failed_when: (grub is changed) or (grub is failed) |
Loading…
Reference in new issue