Skip to content

Commit

Permalink
[edpm_update] Added edpm_update role and update playbook
Browse files Browse the repository at this point in the history
The `edpm_update` role is added to allow the update of packages and
containers on EDPM nodes.

A file called `update.yml` has been added into all impacted roles.

Jira: https://issues.redhat.com/browse/OSPRH-6219
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
  • Loading branch information
rebtoor committed Apr 15, 2024
1 parent 7b0f90a commit 06ea57c
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 6 deletions.
13 changes: 13 additions & 0 deletions playbooks/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

- name: EDPM Update
hosts: "{{ edpm_override_hosts | default('all', true) }}"
strategy: linear
any_errors_fatal: "{{ edpm_any_errors_fatal | default(true) }}"
max_fail_percentage: "{{ edpm_max_fail_percentage | default(0) }}"
tasks:
- name: Import edpm_update
ansible.builtin.import_role:
name: osp.edpm.edpm_update
tags:
- edpm_update
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Copyright 2022 Red Hat, Inc.
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand All @@ -15,8 +15,4 @@
# under the License.


- name: Ensure old cron.daily is absent
become: true
ansible.builtin.file:
path: /etc/cron.daily/containers-tmpwatch
state: absent
# All variables intended for modification should be placed in this file.
7 changes: 7 additions & 0 deletions roles/edpm_update/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
argument_specs:
# ./roles/edpm_update/tasks/main.yml entry point
main:
short_description: The main entry point for the edpm_update role.
description: Multiple lines description
options: {}
43 changes: 43 additions & 0 deletions roles/edpm_update/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# Copyright 2023 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.


galaxy_info:
author: OpenStack
description: EDPM OpenStack Role -- edpm_update
company: Red Hat
license: Apache-2.0
min_ansible_version: '2.14'
namespace: openstack
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: 'EL'
versions:
- '8'
- '9'

galaxy_tags:
- edpm


# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []
23 changes: 23 additions & 0 deletions roles/edpm_update/molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Copyright 2023 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
tasks:
- name: "Dummy task, need to be implemented."
ansible.builtin.debug:
msg: "This is a dummy task, this molecule test need to be implemented."
25 changes: 25 additions & 0 deletions roles/edpm_update/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
driver:
name: podman

provisioner:
inventory:
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
name: ansible
log: true
env:
ANSIBLE_STDOUT_CALLBACK: yaml

scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- check
- verify
- destroy
23 changes: 23 additions & 0 deletions roles/edpm_update/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Copyright 2023 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
tasks:
- name: Dummy tasks
ansible.builtin.debug:
msg: "Dummy preparation task"
94 changes: 94 additions & 0 deletions roles/edpm_update/tasks/containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---

- name: Login to container registries if needed
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: login.yml
tags:
- edpm_podman
- edpm_update

- name: Download images for edpm_iscsid role
ansible.builtin.include_role:
name: osp.edpm.edpm_iscsid
tasks_from: run.yml
tags:
- edpm_iscsid
- edpm_update

- name: Download images for edpm_ovn role
ansible.builtin.include_role:
name: osp.edpm.edpm_ovn
tasks_from: run.yml
tags:
- edpm_ovn
- edpm_update

- name: Download images for edpm_frr role
ansible.builtin.include_role:
name: osp.edpm.edpm_frr
tasks_from: run.yml
tags:
- edpm_frr
- edpm_update

- name: Download images for edpm_ovn_bgp_agent role
ansible.builtin.include_role:
name: osp.edpm.edpm_ovn_bgp_agent
tasks_from: run.yml
tags:
- edpm_ovn_bgp_agent
- edpm_update

- name: Download images for edpm_neutron_metadata role
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_metadata
tasks_from: run.yml
tags:
- edpm_neutron_metadata
- edpm_update

- name: Download images for edpm_neutron_ovn role
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_ovn
tasks_from: run.yml
tags:
- edpm_neutron_ovn
- edpm_update

- name: Download images for edpm_multipathd role
ansible.builtin.include_role:
name: osp.edpm.edpm_multipathd
tasks_from: run.yml
tags:
- edpm_multipathd
- edpm_update

- name: Download images for edpm_nova role
ansible.builtin.include_role:
name: osp.edpm.edpm_nova
tasks_from: run.yml
tags:
- edpm_nova
- edpm_update

- name: Download images for edpm_neutron_sriov role
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_sriov
tasks_from: run.yml
tags:
- edpm_neutron_sriov
- edpm_update

- name: Download images for edpm_neutron_dhcp role
ansible.builtin.include_role:
name: osp.edpm.edpm_neutron_dhcp
tasks_from: run.yml

- name: Download images for edpm_logrotate_crond role
ansible.builtin.include_role:
name: osp.edpm.edpm_logrotate_crond
tasks_from: edpm_update_images.yml
tags:
- edpm_logrotate_crond
- edpm_update
24 changes: 24 additions & 0 deletions roles/edpm_update/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# Copyright 2023 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.


# "edpm_update" will search for and load any operating system variable file

- name: Update packages
ansible.builtin.include_tasks: packages.yml

- name: Update containers
ansible.builtin.include_tasks: containers.yml
9 changes: 9 additions & 0 deletions roles/edpm_update/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- name: Apply updates
ansible.builtin.dnf: # noqa: package-latest
name: "*"
state: latest
update_cache: true
tags:
- edpm_update

0 comments on commit 06ea57c

Please # to comment.