:source: foreman_templates_import.py :orphan: .. _foreman_templates_import_module: foreman_templates_import -- Sync templates from a repository ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. contents:: :local: :depth: 1 Synopsis -------- - Sync provisioning templates, report_templates, partition tables and job templates from external git repository or file system. - Based on foreman_templates plugin https://github.com/theforeman/foreman_templates. Requirements ------------ The below requirements are needed on the host that executes this module. - apypie Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
associate
string
    Choices:
  • always
  • new
  • never
Associate to Operatingsystems, Locations and Organizations based on metadata.
branch
string
Branch of the repo. Only for git-based repositories.
dirname
string
The directory within Git repo containing the templates.
filter
string
Sync only templates with name matching this regular expression, after prefix was applied.
Case-insensitive, snippets are not filtered.
force
boolean
    Choices:
  • no
  • yes
Update templates that are locked.
locations
list / elements=string
List of locations the entity should be assigned to
lock
boolean
    Choices:
  • no
  • yes
Lock imported templates.
negate
boolean
    Choices:
  • no
  • yes
Negate the filter condition.
organizations
list / elements=string
List of organizations the entity should be assigned to
password
string / required
Password of the user accessing the Foreman server
prefix
string
Adds specified string to beginning of all imported templates that do not yet have that prefix.
repo
string
Filesystem path or repo (with protocol), for example /tmp/dir or git://example.com/repo.git or https://example.com/repo.git.
server_url
string / required
URL of the Foreman server
username
string / required
Username accessing the Foreman server
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server

aliases: verify_ssl
verbose
boolean
    Choices:
  • no
  • yes
Add template reports to the output.

Notes ----- .. note:: - Due to a bug in the foreman_templates plugin, this module won't report ``changed=true`` when the only change is the Organization/Location association of the imported templates. Please see https://projects.theforeman.org/issues/29534 for details. - Default values for all module options can be set using :ref:`foreman_setting ` for TemplateSync category or on the settings page in WebUI. Examples -------- .. code-block:: yaml+jinja - name: Sync templates from git repo foreman_templates_import: repo: https://github.com/theforeman/community-templates.git branch: 1.24-stable associate: new server_url: "https://foreman.example.com" username: "admin" password: "changeme" Status ------ - This module is not guaranteed to have a backwards compatible interface. *[preview]* - This module is :ref:`maintained by the Ansible Community `. *[community]* Authors ~~~~~~~ - Anton Nesterov (@nesanton) .. hint:: If you notice any issues in this documentation, you can `edit this document `_ to improve it.