Skip to content

Commit

Permalink
Merge pull request #34 from RedHatSatellite/rel130
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
evgeni authored Jan 12, 2023
2 parents 1c4ed8f + 9be7ee9 commit b52ec23
Show file tree
Hide file tree
Showing 38 changed files with 243 additions and 115 deletions.
5 changes: 2 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
skip_list:
- role-name
- line-length
enable_list:
- only-builtins
9 changes: 0 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.9"
- name: Install dependencies
run: make doc-setup
- name: Build docs
Expand All @@ -31,10 +31,11 @@ jobs:
git checkout gh-pages
rm -rf $(basename ${GITHUB_REF})
mv docs/_build/html $(basename ${GITHUB_REF})
ln --force --no-dereference --symbolic $(dirname v*/index.html | sort --version-sort --reverse | head -n1) latest
git show origin/develop:docs/_gh_include/header.inc > index.html
(echo develop; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<div class="col-md-4 center"><a href="@@/" class="btn-doc btn"><i class="fa fa-newspaper-o"></i><p>@@</p></a></div>' >> index.html
(echo develop; echo latest; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '<div class="col-md-4 center"><a href="@@/" class="btn-doc btn"><i class="fa fa-newspaper-o"></i><p>@@</p></a></div>' >> index.html
git show origin/develop:docs/_gh_include/footer.inc >> index.html
git add $(basename ${GITHUB_REF}) index.html
git add $(basename ${GITHUB_REF}) latest index.html
git commit -m "update docs for $(basename ${GITHUB_REF})" || true
- name: push docs
run: git push origin gh-pages
70 changes: 32 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- devel
include:
- python: "3.8"
ansible: "stable-2.9"
- python: "3.8"
ansible: "stable-2.10"
- python: "2.7"
ansible: "stable-2.11"
- python: "3.5"
Expand All @@ -31,35 +34,27 @@ jobs:
ansible: "stable-2.11"
- python: "3.7"
ansible: "stable-2.11"
- python: "3.9"
ansible: "devel"
- python: "3.10"
ansible: "devel"
- python: "3.11"
ansible: "devel"
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Restore pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install libyaml-dev for PyYAML
run: sudo apt-get install -y libyaml-dev
- name: Install Ansible
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz
- name: Install dependencies
run: make test-setup
- name: Install required collections for ansible-base (2.10+)
run: ansible-galaxy collection install community.general
if: matrix.ansible != 'stable-2.9'
- name: Run sanity tests
run: make SANITY_OPTS="--local" sanity
if: matrix.ansible != 'stable-2.9'
if: matrix.ansible != 'stable-2.9' && matrix.ansible != 'stable-2.10' && matrix.ansible != 'stable-2.11'

docs:
runs-on: ubuntu-latest
Expand All @@ -68,14 +63,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Restore pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: "3.9"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: make doc-setup
- name: Build docs
Expand All @@ -93,14 +83,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Restore pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
python-version: "3.9"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: |
pip install --upgrade ansible-core
Expand All @@ -116,26 +101,35 @@ jobs:
path: theforeman-operations-*.tar.gz

molecule:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python:
- "3.9"
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- devel
include:
- python: "3.8"
ansible: "stable-2.9"
- python: "3.8"
ansible: "stable-2.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: ${{ matrix.python }}
- name: Install Ansible
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz
- name: Install dependencies
run: make test-setup
- name: Install Ansible 2.9 compatible molecule
run: pip install --upgrade 'molecule[docker,lint]<4.0'
if: matrix.ansible == 'stable-2.9'
- name: Run tests
env:
DRIVER_NAME: docker
Expand All @@ -148,7 +142,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
- name: Install Ansible
run: pip install --upgrade ansible
- name: Build Ansible Collection
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ redhat.satellite_operations Release Notes
.. contents:: Topics


v1.3.0
======

Minor Changes
-------------

- new role to configure backups using ``foreman-maintain``

Bugfixes
--------

- cloud_connector role - Ensure ``rhcd.service`` starts after system reboots
- fix paths in execution-environment.yml (https://bugzilla.redhat.com/show_bug.cgi?id=2156941)

v1.2.3
======

Expand Down
8 changes: 8 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ releases:
bugfixes:
- cloud_connector role - use correct hostname variable when talking to console.redhat.com
release_date: '2022-06-15'
1.3.0:
changes:
bugfixes:
- cloud_connector role - Ensure ``rhcd.service`` starts after system reboots
- fix paths in execution-environment.yml (https://bugzilla.redhat.com/show_bug.cgi?id=2156941)
minor_changes:
- new role to configure backups using ``foreman-maintain``
release_date: '2023-01-04'
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'recommonmark',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'ansible_basic_sphinx_ext',
'sphinx_antsibull_ext',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
5 changes: 2 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
antsibull>=0.17.0
ansible-base>=2.10.0rc2
antsibull-docs>=1
ansible-core
sphinx-rtd-theme
git+https://github.com/felixfontein/ansible-basic-sphinx-ext
recommonmark
5 changes: 3 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ authors:
- "Eric D. Helms <[email protected]>"
- "Evgeni Golov <[email protected]>"
- "Ewoud Kohl van Wijngaarden <[email protected]>"
- "Jeremy Audet <[email protected]>"
- "Jeffrey van Pelt <[email protected]>"
- "Jeremy Audet <[email protected]>"
- "Kyle Williams <[email protected]>"
- "Matthias Dellweg <[email protected]>"
- "Robert Rettig <[email protected]>"
- "willtome <[email protected]>"
version: "1.2.3"
version: "1.3.0"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
2 changes: 1 addition & 1 deletion meta/execution-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ build_arg_defaults:
EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest'

dependencies:
python: ../requirements.txt
python: requirements.txt
1 change: 1 addition & 0 deletions meta/requirements.txt
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pylint==2.6.0; python_version >= '3.6'
voluptuous==0.12.1 # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt
yamllint
molecule[docker,lint]
ansible-lint<6
ansible-lint
2 changes: 1 addition & 1 deletion requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8<4
yamllint
ansible-lint<6
ansible-lint>=6.1.0
galaxy-importer
24 changes: 24 additions & 0 deletions roles/backup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
redhat.satellite_operations.backup
============================

Sets up backup cronjob using `satellite_maintain`, creating one full backup each Sunday and incremental ones otherwise.

Role Variables
--------------

* `satellite_backup_destination`: Destination where to write the backups to, defaults to `/var/backup/foreman`
* `satellite_backup_type`: Backup type, can be either `online` or `offline`, defaults to `online`
* `satellite_backup_keep_full`: How many full (weekly) backups to keep, defaults to `2`

None

Example Playbooks
-----------------

```yaml
---
- hosts: all
gather_facts: true
roles:
- backup
```
4 changes: 4 additions & 0 deletions roles/backup/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
satellite_backup_destination: /var/backup/foreman
satellite_backup_type: online
satellite_backup_keep_full: 2
5 changes: 5 additions & 0 deletions roles/backup/molecule/satellite/collections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
collections:
- name: community.docker
version: ">=3,<4"
- name: community.general
version: ">=2,<3"
6 changes: 6 additions & 0 deletions roles/backup/molecule/satellite/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Converge
hosts: all
gather_facts: true
roles:
- backup
22 changes: 22 additions & 0 deletions roles/backup/molecule/satellite/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
dependency:
name: galaxy
driver:
name: ${DRIVER_NAME:-podman}
platforms:
- name: centos8
image: quay.io/centos/centos:stream8
command: /sbin/init
tmpfs:
- /run
- /tmp:exec,mode=777
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint -c ../../.yamllint .
YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint .
10 changes: 10 additions & 0 deletions roles/backup/molecule/satellite/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Prepare
hosts: all
gather_facts: true
pre_tasks:
- name: Install crontabs
ansible.builtin.package:
name: crontabs
roles:
- backup
16 changes: 16 additions & 0 deletions roles/backup/molecule/satellite/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Get cronjob file
ansible.builtin.slurp:
path: /etc/cron.daily/foreman-backup
register: backupcron

- name: Check foreman cronjob content
ansible.builtin.assert:
that:
- "'/var/backup/foreman' in crobjobcontent"
vars:
crobjobcontent: "{{ backupcron['content'] | b64decode }}"
8 changes: 8 additions & 0 deletions roles/backup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Configure backup cronjob
ansible.builtin.template:
src: templates/foreman-backup.sh.j2
dest: /etc/cron.daily/foreman-backup
owner: root
group: root
mode: '0750'
Loading

0 comments on commit b52ec23

Please sign in to comment.