-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f98883
Showing
10 changed files
with
839 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: "chore(ci): " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare version | ||
id: prep | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
echo ::set-output name=version::${VERSION} | ||
- name: Deploy the collection | ||
uses: artis3n/ansible_galaxy_collection@v2 | ||
with: | ||
api_key: ${{ secrets.GALAXY_API_KEY }} | ||
galaxy_version: ${{ steps.prep.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Lint and Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
flake8 . --count --show-source --statistics | ||
- name: Lint with black | ||
run: | | ||
pip install --pre black | ||
black . | ||
- name: Lint with ansible-lint | ||
uses: ansible-community/ansible-lint-action@v6 | ||
with: | ||
targets: | | ||
roles/locations |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Ansible Collection - radiorabe.foreman | ||
|
||
Contains foreman roles and playbooks. | ||
|
||
## Roles | ||
|
||
* [`locations`](https://github.com/radiorabe/ansible-collection-foreman/tree/main/roles/locations) | ||
|
||
## License | ||
|
||
This collection is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace: radiorabe | ||
name: foreman | ||
version: 0.0.0 | ||
readme: README.md | ||
authors: | ||
- Lucas Bickel <@hairmare> | ||
description: Roles managing Foreman (mainly what's missing from FAM) | ||
license_file: LICENSE | ||
tags: | ||
- radiorabe | ||
- foreman | ||
dependencies: {} | ||
repository: https://github.com/radiorabe/ansible-collection-foreman | ||
documentation: https://github.com/radiorabe/ansible-collection-foreman/blob/main/README.md | ||
homepage: hhttps://github.com/radiorabe/ansible-collection-foreman | ||
issues: https://github.com/radiorabe/ansible-collection-foreman/issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requires_ansible: ">=2.11,<2.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Ansible Role - radiorabe.formman.locations | ||
|
||
This role creates and manages locations in Foreman. | ||
|
||
## Requirements | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
|
||
## Role Variables | ||
|
||
This role supports the [FAM Common Role Variables](https://github.com/theforeman/foreman-ansible-modules/blob/develop/README.md#common-role-variables). | ||
|
||
The main data structure for this role is the list of `foreman_locations`. Each `location` requires the following fields: | ||
|
||
- `name`: The name of the location. | ||
|
||
The following fields are optional in the sense that the server will use default values when they are omitted: | ||
|
||
- `parent`: Title of a parent Location for nesting. | ||
- `organizations`: List of organizations the location should be assigned to. | ||
- `state`: The state of the location. Can be `present` or `absent`. | ||
|
||
## Dependencies | ||
|
||
The `radiorabe.foreman.locations` role depends on modules from the [`theforeman.foreman`](https://galaxy.ansible.com/theforeman/foreman) collection. | ||
|
||
## Example Playbooks | ||
|
||
```yaml | ||
- name: add location to foreman | ||
hosts: localhost | ||
gather_facts: false | ||
roles: | ||
- role: radiorabe.foreman.locations | ||
vars: | ||
foreman_server_url: https://foreman.example.com | ||
foreman_username: admin | ||
foreman_password: changeme | ||
foreman_organizations: | ||
- name: Randweg | ||
origanizations: | ||
- RaBe | ||
state: present | ||
``` | ||
## License | ||
This role is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
galaxy_info: | ||
author: RaBe IT-Reaktion | ||
description: Creates and manages locations in Foreman. | ||
issue_tracker_url: https://github.com/radiorabe/ansible-collection-foreman/issues | ||
license: AGPL-3.0-only | ||
min_ansible_version: 2.9 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- name: Fedora | ||
version: | ||
- all | ||
galaxy_tags: | ||
- radiorabe | ||
- foreman | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: Add locations | ||
theforeman.foreman.location: | ||
# common args | ||
server_url: "{{ foreman_server_url | default(omit) }}" | ||
username: "{{ foreman_username | default(omit) }}" | ||
password: "{{ foreman_password | default(omit) }}" | ||
validate_certs: "{{ foreman_validate_certs | default(omit) }}" | ||
# location args | ||
name: "{{ foreman_locations_item.name }}" | ||
parent: "{{ foreman_locations_item.parent | default(omit) }}" | ||
organizations: "{{ foreman_locations_item.organizations | default(omit) }}" | ||
state: "{{ foreman_locations_item.state | default(omit) }}" | ||
loop: "{{ foreman_locations | default([]) }}" | ||
loop_control: | ||
loop_var: foreman_locations_item |