.. Document meta :orphan: .. Anchors .. _ansible_collections.theforeman.foreman.templates_import_module: .. Anchors: short name for ansible.builtin .. Anchors: aliases .. Title theforeman.foreman.templates_import -- Sync Templates from a repository +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This plugin is part of the `theforeman.foreman collection `_ (version 2.1.2). To install it use: :code:`ansible-galaxy collection install theforeman.foreman`. To use it in a playbook, specify: :code:`theforeman.foreman.templates_import`. .. version_added .. versionadded:: 1.0.0 of theforeman.foreman .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - 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. .. Aliases .. Requirements Requirements ------------ The below requirements are needed on the host that executes this module. - requests .. Options 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.
If the value is not specified in the task, the value of environment variable FOREMAN_PASSWORD will be used instead.
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.
If the value is not specified in the task, the value of environment variable FOREMAN_SERVER_URL will be used instead.
username
string / required
Username accessing the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_USERNAME will be used instead.
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server.
If the value is not specified in the task, the value of environment variable FOREMAN_VALIDATE_CERTS will be used instead.
verbose
boolean
    Choices:
  • no
  • yes
Add template reports to the output.

.. Notes 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:`theforeman.foreman.setting ` for TemplateSync category or on the settings page in WebUI. .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja - name: Sync templates from git repo theforeman.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" .. Facts .. Return values Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: .. raw:: html
Key Returned Description
message
dictionary
success
Information about the import.

 
branch
string
success
Branch used in the repository.

 
repo
string
success
Repository, the templates were imported from.

report
dictionary
success
Report of the import.

 
changed
list / elements=string
success
List of templates that have been updated.

 
new
list / elements=string
success
List of templates that have been created.

templates
dictionary
success
Final state of the templates.



.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - Anton Nesterov (@nesanton) .. Parsing errors