Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.3.0 #34

Merged
merged 38 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b8c1f58
bump version to 1.3.0-dev again
evgeni Jun 8, 2022
7dddc4a
rename tasks files to be .yml
evgeni Jun 14, 2022
82ccda8
also enable pulpcore module when enabling katello
evgeni Jun 14, 2022
5879b37
Release 1.2.3
evgeni Jun 17, 2022
c5b4e2d
bump version to 1.3.0-dev again
evgeni Jun 17, 2022
ef55553
don't run ansible devel tests on Python 3.8
evgeni Aug 29, 2022
8a0d69e
update community.docker to 3
evgeni Aug 29, 2022
3f42f74
disable 2.9 tests for now
evgeni Aug 29, 2022
1b59f30
Revert "disable 2.9 tests for now"
evgeni Aug 29, 2022
5010bca
Install Ansible 2.9 compatible molecule
evgeni Aug 29, 2022
dafa5eb
Enable rhcd.service
Ichimonji10 Aug 24, 2022
6fc1ecd
update debian tests to debian:11
evgeni Sep 12, 2022
58992a4
drop EL7 tests
evgeni Sep 12, 2022
1d6ba2a
test puppet 6 to 7, not 5 to 6
evgeni Sep 12, 2022
8fbf65e
Update README.md
flybyray Sep 20, 2022
dc29ff2
fix paths in execution-environment.yml
evgeni Sep 12, 2022
f837d39
update default puppet to 7
evgeni Sep 12, 2022
90d4c6f
add ansible-core 2.14 to CI
evgeni Sep 27, 2022
f4c3491
add backup role
evgeni Aug 29, 2022
738cb37
also test on python 3.11
evgeni Oct 25, 2022
2ad58c4
simplify codeql fetching -- the bug that required this is fixed
evgeni Nov 24, 2022
7a4400f
use Python 3.9 as the default Python
evgeni Nov 24, 2022
72f1828
create latest symlink when publishing docs
evgeni Nov 24, 2022
4ca2fe6
Run on Ubuntu 20.04 to still be able to test Python 2.7 and 3.5/3.6
evgeni Nov 24, 2022
134178a
no need to install community.general, we don't need it in tests
evgeni Nov 24, 2022
a1a2e91
use setup-python's cache feature
evgeni Nov 24, 2022
4fb7b90
also run molecule on ubuntu 20.04
evgeni Dec 5, 2022
44c77a5
Update ansible-lint to 6.1+ and enable only-builtins rule
evgeni Nov 24, 2022
4bbbfc7
make tests name[casing] correct
evgeni Dec 5, 2022
abf8883
make name[template] lint happy
evgeni Dec 5, 2022
42454be
always use FQCN names
evgeni Dec 5, 2022
3308f12
make ansible-lint use our yamllint config
evgeni Dec 16, 2022
f376c9b
update docs build from FAM
evgeni Dec 16, 2022
af1bed3
run molecule against ansible 2.14 too
evgeni Jan 4, 2023
689b439
Update default Foreman to 3.5
evgeni Jan 4, 2023
30e6a62
release 1.3.0
evgeni Jan 4, 2023
e4ee227
Merge foreman-operations-collection 1.3.0 into rel130
evgeni Jan 9, 2023
9be7ee9
fix FQCN in fake role
evgeni Jan 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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