This is the Ansible Collection provided by the Ansible Edge Automation Team for automating actions in Red Hat Edge Management
This Collection is meant for distribution through Ansible Galaxy as is available for all Ansible users to utilize, contribute to, and provide feedback about.
This collection has been tested against following Ansible versions: >=2.11.
Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. PEP440 is the schema used to describe the versions of Ansible.
You can install the Edge Management collection with the Ansible Galaxy CLI:
ansible-galaxy collection install consoledot.edgemanagement
You can also include it in a requirements.yml
file and install it with ansible-galaxy collection install -r requirements.yml
, using the format:
---
collections:
- name: consoledot.edgemanagement
An example for using this collection to manage a log source with Red Hat Edge Manager is as follows.
For password-based auth, inventory.ini
(Note the password should be managed by a Vault for a production environment).
[CRC]
console.redhat.com
[CRC:vars]
ansible_network_os=consoledot.edgemanagement.consoledot
ansible_connection=ansible.netcommon.httpapi
ansible_user=foobar@example.com
ansible_httpapi_pass=SuperSekretPassword
ansible_httpapi_use_ssl=yes
ansible_httpapi_validate_certs=yes
You can obtain a Red Hat API Offline Token by following the documentation here, and then provide that in the ansible_httpapi_consoledot_offline_token
inventory var as follows (Note the password should be managed by a Vault for a production environment).
[CRC]
console.redhat.com
[CRC:vars]
ansible_connection=ansible.netcommon.httpapi
ansible_network_os=consoledot.edgemanagement.consoledot
ansible_httpapi_use_ssl=yes
ansible_httpapi_validate_certs=yes
ansible_httpapi_consoledot_offline_token="MY_RED_HAT_API_OFFLINE_TOKEN_HERE"
With Ansible Collections there are various ways to utilize them either by calling specific Content from the Collection, such as a module, by its Fully Qualified Collection Name (FQCN) as we'll show in this example or by defining a Collection Search Path as the examples below will display.
---
- name: Get a list of Edge Images
hosts: CRC
gather_facts: false
tasks:
- name: get image info
consoledot.edgemanagement.images_info:
register: images_info_out
- debug: var=images_info_out
docs/
: local documentation for the collectionlicense.txt
: optional copy of license(s) for this collectiongalaxy.yml
: source data for the MANIFEST.json that will be part of the collection packageplaybooks/
: playbooks reside heretasks/
: this holds 'task list files' forinclude_tasks
/import_tasks
usage
plugins/
: all ansible plugins and modules go here, each in its own subdirmodules/
: ansible moduleslookups/
: lookup pluginsfilters/
: Jinja2 filter plugins- ... rest of plugins
README.md
: information file (this file)roles/
: directory for ansible rolestests/
: tests for the collection's content
We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the Red Hat Edge Manager collection repository. See Contributing to Ansible-maintained collections for complete details.
See the Ansible Community Guide for details on contributing to Ansible.
This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.
- Ansible Collection overview
- Ansible User guide
- Ansible Developer guide
- Ansible Community code of conduct
MIT
See LICENSE to see the full text.
This collection relies on the ansible.netcommon
collection, so if you're using ansible-core
and not ansible
then you will need to run the following command:
$ ansible-galaxy install -r requirements.yml
To use this while developing, run the following commands from within your local checkout to this git repo in order to symlink this git repo to the appropriate Ansible Collection path
$ mkdir -p ~/.ansible/collections/ansible_collections/consoledot
$ ln -s $(pwd) ~/.ansible/collections/ansible_collections/consoledot/edgemanagement
Make sure to set the proxy vars on the command line or in your shell environment if needed (required for devs using console.stage.redhat.com
:
$ HTTP_PROXY=http://proxy.foo.com:3128 HTTPS_PROXY=http://proxy.foo.com:3128 ansible-playbook myplaybook.yml -i myinventory.ini