redhat.satellite.provisioning_template – Manage Provisioning Templates¶
Note
This plugin is part of the redhat.satellite collection (version 2.2.0).
To install it use: ansible-galaxy collection install redhat.satellite
.
To use it in a playbook, specify: redhat.satellite.provisioning_template
.
New in version 1.0.0: of redhat.satellite
Parameters¶
Examples¶
# Keep in mind, that in this case, the inline parameters will be overwritten
- name: "Create a Provisioning Template inline"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: A New Finish Template
kind: finish
state: present
template: |
<%#
name: Finish timetravel
kind: finish
%>
cd /
rm -rf *
locations:
- Gallifrey
organizations:
- TARDIS INC
- name: "Create a Provisioning Template from a file"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
file_name: timeywimey_template.erb
state: present
locations:
- Gallifrey
organizations:
- TARDIS INC
# Due to the module logic, deleting requires a template dummy,
# either inline or from a file.
- name: "Delete a Provisioning Template"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: timeywimey_template
template: |
<%#
dummy:
%>
state: absent
- name: "Create a Provisioning Template from a file and modify with parameter"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
file_name: timeywimey_template.erb
name: Wibbly Wobbly Template
state: present
locations:
- Gallifrey
organizations:
- TARDIS INC
# Providing a name in this case wouldn't be very sensible.
# Alternatively make use of with_filetree to parse recursively with filter.
- name: "Parsing a directory of provisioning templates"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
file_name: "{{ item }}"
state: present
locations:
- SKARO
organizations:
- DALEK INC
with_fileglob:
- "./arsenal_templates/*.erb"
# If the templates are stored locally and the ansible module is executed on a remote host
- name: Ensure latest version of all Provisioning Community Templates
redhat.satellite.provisioning_template:
server_url: "https://satellite.example.com"
username: "admin"
password: "changeme"
state: present
template: '{{ lookup("file", item.src) }}'
with_filetree: '/path/to/provisioning/templates'
when: item.state == 'file'
# with name set to "*" bulk actions can be performed
- name: "Delete *ALL* provisioning templates"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "*"
state: absent
- name: "Assign all provisioning templates to the same organization(s)"
redhat.satellite.provisioning_template:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
name: "*"
state: present
organizations:
- DALEK INC
- sky.net
- Doc Brown's garage
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Bernhard Hopfenmueller (@Fobhep) ATIX AG
Matthias Dellweg (@mdellweg) ATIX AG