mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-30 10:26:52 +00:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a66140cd3 | ||
|
|
a56cef869d | ||
|
|
53d45efc02 | ||
|
|
c70d79c787 | ||
|
|
b37a0d4397 | ||
|
|
bf8e788964 | ||
|
|
8adc746d90 | ||
|
|
992e14e424 | ||
|
|
3d6cb8fe77 | ||
|
|
c694ceaf95 | ||
|
|
df91c522a4 | ||
|
|
35c0c10e28 | ||
|
|
c97b4e6201 | ||
|
|
1cd0afd3df | ||
|
|
6f14461d0b | ||
|
|
523514713c | ||
|
|
be0694ac21 | ||
|
|
5dde703246 | ||
|
|
c23dbb83d0 | ||
|
|
ae94c11a78 | ||
|
|
a29a365beb | ||
|
|
ba9ec71dba | ||
|
|
ee4e1d997b | ||
|
|
1327d81dd7 | ||
|
|
6ceaee2c9f | ||
|
|
502cc3900e | ||
|
|
2947acb77c | ||
|
|
a4d8929a7e | ||
|
|
e80519dc71 | ||
|
|
53f9958b25 | ||
|
|
a925e020dc | ||
|
|
9512a389f3 | ||
|
|
7c987d7498 | ||
|
|
45d461c0ec | ||
|
|
d1877e1915 | ||
|
|
fa67df12a9 | ||
|
|
65dde57c1a | ||
|
|
6f4167fb01 | ||
|
|
8e37b46912 | ||
|
|
1e83d0a5a8 | ||
|
|
329b01c7af |
@@ -24,15 +24,13 @@ schedules:
|
|||||||
always: true
|
always: true
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- stable-3
|
|
||||||
- stable-4
|
- stable-4
|
||||||
- cron: 0 11 * * 0
|
- cron: 0 11 * * 0
|
||||||
displayName: Weekly (old stable branches)
|
displayName: Weekly (old stable branches)
|
||||||
always: true
|
always: true
|
||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- stable-1
|
- stable-3
|
||||||
- stable-2
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- name: checkoutPath
|
- name: checkoutPath
|
||||||
@@ -225,12 +223,12 @@ stages:
|
|||||||
test: macos/12.0
|
test: macos/12.0
|
||||||
- name: RHEL 7.9
|
- name: RHEL 7.9
|
||||||
test: rhel/7.9
|
test: rhel/7.9
|
||||||
- name: RHEL 8.5
|
- name: RHEL 9.0
|
||||||
test: rhel/8.5
|
test: rhel/9.0
|
||||||
- name: FreeBSD 12.3
|
- name: FreeBSD 12.3
|
||||||
test: freebsd/12.3
|
test: freebsd/12.3
|
||||||
- name: FreeBSD 13.0
|
- name: FreeBSD 13.1
|
||||||
test: freebsd/13.0
|
test: freebsd/13.1
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
@@ -329,16 +327,16 @@ stages:
|
|||||||
targets:
|
targets:
|
||||||
- name: CentOS 7
|
- name: CentOS 7
|
||||||
test: centos7
|
test: centos7
|
||||||
- name: Fedora 34
|
|
||||||
test: fedora34
|
|
||||||
- name: Fedora 35
|
- name: Fedora 35
|
||||||
test: fedora35
|
test: fedora35
|
||||||
|
- name: Fedora 36
|
||||||
|
test: fedora36
|
||||||
- name: openSUSE 15
|
- name: openSUSE 15
|
||||||
test: opensuse15
|
test: opensuse15
|
||||||
- name: Ubuntu 18.04
|
|
||||||
test: ubuntu1804
|
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 20.04
|
||||||
test: ubuntu2004
|
test: ubuntu2004
|
||||||
|
- name: Ubuntu 22.04
|
||||||
|
test: ubuntu2204
|
||||||
- name: Alpine 3
|
- name: Alpine 3
|
||||||
test: alpine3
|
test: alpine3
|
||||||
groups:
|
groups:
|
||||||
@@ -375,8 +373,8 @@ stages:
|
|||||||
test: centos6
|
test: centos6
|
||||||
- name: Fedora 34
|
- name: Fedora 34
|
||||||
test: fedora34
|
test: fedora34
|
||||||
- name: Ubuntu 20.04
|
- name: Ubuntu 18.04
|
||||||
test: ubuntu2004
|
test: ubuntu1804
|
||||||
groups:
|
groups:
|
||||||
- 1
|
- 1
|
||||||
- 2
|
- 2
|
||||||
|
|||||||
34
.github/BOTMETA.yml
vendored
34
.github/BOTMETA.yml
vendored
@@ -126,15 +126,23 @@ files:
|
|||||||
maintainers: giner
|
maintainers: giner
|
||||||
$filters/from_csv.py:
|
$filters/from_csv.py:
|
||||||
maintainers: Ajpantuso
|
maintainers: Ajpantuso
|
||||||
$filters/groupby:
|
$filters/groupby.py:
|
||||||
maintainers: felixfontein
|
maintainers: felixfontein
|
||||||
$filters/hashids:
|
$filters/groupby_as_dict.yml:
|
||||||
|
maintainers: felixfontein
|
||||||
|
$filters/hashids.py:
|
||||||
|
maintainers: Ajpantuso
|
||||||
|
$filters/hashids_decode.yml:
|
||||||
|
maintainers: Ajpantuso
|
||||||
|
$filters/hashids_encode.yml:
|
||||||
maintainers: Ajpantuso
|
maintainers: Ajpantuso
|
||||||
$filters/jc.py:
|
$filters/jc.py:
|
||||||
maintainers: kellyjonbrazil
|
maintainers: kellyjonbrazil
|
||||||
$filters/json_query.py: {}
|
$filters/json_query.py: {}
|
||||||
$filters/list.py:
|
$filters/list.py:
|
||||||
maintainers: vbotka
|
maintainers: vbotka
|
||||||
|
$filters/lists_mergeby.yml:
|
||||||
|
maintainers: vbotka
|
||||||
$filters/path_join_shim.py:
|
$filters/path_join_shim.py:
|
||||||
maintainers: felixfontein
|
maintainers: felixfontein
|
||||||
$filters/random_mac.py: {}
|
$filters/random_mac.py: {}
|
||||||
@@ -142,6 +150,24 @@ files:
|
|||||||
maintainers: resmo
|
maintainers: resmo
|
||||||
$filters/unicode_normalize.py:
|
$filters/unicode_normalize.py:
|
||||||
maintainers: Ajpantuso
|
maintainers: Ajpantuso
|
||||||
|
$filters/to_days.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_hours.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_milliseconds.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_minutes.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_months.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_seconds.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_time_unit.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_weeks.yml:
|
||||||
|
maintainers: resmo
|
||||||
|
$filters/to_years.yml:
|
||||||
|
maintainers: resmo
|
||||||
$filters/version_sort.py:
|
$filters/version_sort.py:
|
||||||
maintainers: ericzolf
|
maintainers: ericzolf
|
||||||
$inventories/:
|
$inventories/:
|
||||||
@@ -595,7 +621,7 @@ files:
|
|||||||
$modules/monitoring/nagios.py:
|
$modules/monitoring/nagios.py:
|
||||||
maintainers: tbielawa tgoetheyn
|
maintainers: tbielawa tgoetheyn
|
||||||
$modules/monitoring/newrelic_deployment.py:
|
$modules/monitoring/newrelic_deployment.py:
|
||||||
maintainers: mcodd
|
ignore: mcodd
|
||||||
$modules/monitoring/pagerduty.py:
|
$modules/monitoring/pagerduty.py:
|
||||||
maintainers: suprememoocow thaumos
|
maintainers: suprememoocow thaumos
|
||||||
labels: pagerduty
|
labels: pagerduty
|
||||||
@@ -687,7 +713,7 @@ files:
|
|||||||
$modules/notification/discord.py:
|
$modules/notification/discord.py:
|
||||||
maintainers: cwollinger
|
maintainers: cwollinger
|
||||||
$modules/notification/flowdock.py:
|
$modules/notification/flowdock.py:
|
||||||
maintainers: mcodd
|
ignore: mcodd
|
||||||
$modules/notification/grove.py:
|
$modules/notification/grove.py:
|
||||||
maintainers: zimbatm
|
maintainers: zimbatm
|
||||||
$modules/notification/hipchat.py:
|
$modules/notification/hipchat.py:
|
||||||
|
|||||||
104
.gitignore
vendored
104
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
# Created by https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
||||||
|
|
||||||
### dotenv ###
|
### dotenv ###
|
||||||
.env
|
.env
|
||||||
@@ -71,7 +71,19 @@ flycheck_*.el
|
|||||||
*_LOCAL_*.txt
|
*_LOCAL_*.txt
|
||||||
*_REMOTE_*.txt
|
*_REMOTE_*.txt
|
||||||
|
|
||||||
#!! ERROR: jupyternotebook is undefined. Use list command to see defined gitignore types !!#
|
### JupyterNotebooks ###
|
||||||
|
# gitignore template for Jupyter Notebooks
|
||||||
|
# website: http://jupyter.org/
|
||||||
|
|
||||||
|
.ipynb_checkpoints
|
||||||
|
*/.ipynb_checkpoints/*
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# Remove previous ipynb_checkpoints
|
||||||
|
# git rm -r .ipynb_checkpoints/
|
||||||
|
|
||||||
### Linux ###
|
### Linux ###
|
||||||
|
|
||||||
@@ -87,6 +99,39 @@ flycheck_*.el
|
|||||||
# .nfs files are created when an open file is removed but is still being accessed
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
.nfs*
|
.nfs*
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### macOS Patch ###
|
||||||
|
# iCloud generated files
|
||||||
|
*.icloud
|
||||||
|
|
||||||
### PyCharm+all ###
|
### PyCharm+all ###
|
||||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
@@ -151,6 +196,9 @@ atlassian-ide-plugin.xml
|
|||||||
# Cursive Clojure plugin
|
# Cursive Clojure plugin
|
||||||
.idea/replstate.xml
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
.idea/sonarlint/
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
com_crashlytics_export_strings.xml
|
com_crashlytics_export_strings.xml
|
||||||
crashlytics.properties
|
crashlytics.properties
|
||||||
@@ -164,20 +212,13 @@ fabric.properties
|
|||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
### PyCharm+all Patch ###
|
### PyCharm+all Patch ###
|
||||||
# Ignores the whole .idea folder and all .iml files
|
# Ignore everything but code style settings and run configurations
|
||||||
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
|
# that are supposed to be shared within teams.
|
||||||
|
|
||||||
.idea/
|
.idea/*
|
||||||
|
|
||||||
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
|
!.idea/codeStyles
|
||||||
|
!.idea/runConfigurations
|
||||||
*.iml
|
|
||||||
modules.xml
|
|
||||||
.idea/misc.xml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
# Sonarlint plugin
|
|
||||||
.idea/sonarlint
|
|
||||||
|
|
||||||
### pydev ###
|
### pydev ###
|
||||||
.pydevproject
|
.pydevproject
|
||||||
@@ -260,16 +301,13 @@ docs/_build/
|
|||||||
target/
|
target/
|
||||||
|
|
||||||
# Jupyter Notebook
|
# Jupyter Notebook
|
||||||
.ipynb_checkpoints
|
|
||||||
|
|
||||||
# IPython
|
# IPython
|
||||||
profile_default/
|
|
||||||
ipython_config.py
|
|
||||||
|
|
||||||
# pyenv
|
# pyenv
|
||||||
# For a library or package, you might want to ignore these files since the code is
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
.python-version
|
# .python-version
|
||||||
|
|
||||||
# pipenv
|
# pipenv
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
@@ -278,7 +316,22 @@ ipython_config.py
|
|||||||
# install all needed dependencies.
|
# install all needed dependencies.
|
||||||
#Pipfile.lock
|
#Pipfile.lock
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
# poetry
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||||
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
|
# commonly ignored for libraries.
|
||||||
|
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||||
|
#poetry.lock
|
||||||
|
|
||||||
|
# pdm
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||||
|
#pdm.lock
|
||||||
|
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||||
|
# in version control.
|
||||||
|
# https://pdm.fming.dev/#use-with-ide
|
||||||
|
.pdm.toml
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||||
__pypackages__/
|
__pypackages__/
|
||||||
|
|
||||||
# Celery stuff
|
# Celery stuff
|
||||||
@@ -320,6 +373,13 @@ dmypy.json
|
|||||||
# Cython debug symbols
|
# Cython debug symbols
|
||||||
cython_debug/
|
cython_debug/
|
||||||
|
|
||||||
|
# PyCharm
|
||||||
|
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||||
|
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||||
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
|
#.idea/
|
||||||
|
|
||||||
### Vim ###
|
### Vim ###
|
||||||
# Swap
|
# Swap
|
||||||
[._]*.s[a-v][a-z]
|
[._]*.s[a-v][a-z]
|
||||||
@@ -381,6 +441,8 @@ tags
|
|||||||
|
|
||||||
# Cursive Clojure plugin
|
# Cursive Clojure plugin
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
|
||||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
|
||||||
# Editor-based Rest Client
|
# Editor-based Rest Client
|
||||||
@@ -443,4 +505,4 @@ $RECYCLE.BIN/
|
|||||||
# Windows shortcuts
|
# Windows shortcuts
|
||||||
*.lnk
|
*.lnk
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs,dotenv
|
# End of https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
|
||||||
@@ -6,6 +6,45 @@ Community General Release Notes
|
|||||||
|
|
||||||
This changelog describes changes after version 3.0.0.
|
This changelog describes changes after version 3.0.0.
|
||||||
|
|
||||||
|
v4.8.2
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Regular maintenance and bugfix release.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Include ``simplified_bsd.txt`` license file for various module utils, the ``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
|
||||||
|
- consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680).
|
||||||
|
- filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700).
|
||||||
|
- filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700).
|
||||||
|
- gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668).
|
||||||
|
- keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241).
|
||||||
|
- redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733).
|
||||||
|
- xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682).
|
||||||
|
|
||||||
|
v4.8.1
|
||||||
|
======
|
||||||
|
|
||||||
|
Release Summary
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Regular bugfix release. From now on, only bugfix release will be made of the community.general 4.x.y release stream.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
|
||||||
|
- consul - fixed bug where class ``ConsulService`` was overwriting the field ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590).
|
||||||
|
- gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647).
|
||||||
|
- onepassword - search all valid configuration locations and use the first found (https://github.com/ansible-collections/community.general/pull/4640).
|
||||||
|
- opentelemetry callback plugin - fix task message attribute that is reported failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624).
|
||||||
|
- opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623).
|
||||||
|
- terraform - fix list initialization to support both Python 2 and Python 3 (https://github.com/ansible-collections/community.general/issues/4531).
|
||||||
|
|
||||||
v4.8.0
|
v4.8.0
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|||||||
48
PSF-license.txt
Normal file
48
PSF-license.txt
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||||
|
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||||
|
otherwise using this software ("Python") in source or binary form and
|
||||||
|
its associated documentation.
|
||||||
|
|
||||||
|
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
||||||
|
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
||||||
|
analyze, test, perform and/or display publicly, prepare derivative works,
|
||||||
|
distribute, and otherwise use Python alone or in any derivative version,
|
||||||
|
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
||||||
|
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
|
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
|
||||||
|
All Rights Reserved" are retained in Python alone or in any derivative version
|
||||||
|
prepared by Licensee.
|
||||||
|
|
||||||
|
3. In the event Licensee prepares a derivative work that is based on
|
||||||
|
or incorporates Python or any part thereof, and wants to make
|
||||||
|
the derivative work available to others as provided herein, then
|
||||||
|
Licensee hereby agrees to include in any such work a brief summary of
|
||||||
|
the changes made to Python.
|
||||||
|
|
||||||
|
4. PSF is making Python available to Licensee on an "AS IS"
|
||||||
|
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||||
|
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
||||||
|
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||||
|
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
||||||
|
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||||
|
|
||||||
|
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||||
|
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||||
|
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
||||||
|
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||||
|
|
||||||
|
6. This License Agreement will automatically terminate upon a material
|
||||||
|
breach of its terms and conditions.
|
||||||
|
|
||||||
|
7. Nothing in this License Agreement shall be deemed to create any
|
||||||
|
relationship of agency, partnership, or joint venture between PSF and
|
||||||
|
Licensee. This License Agreement does not grant permission to use PSF
|
||||||
|
trademarks or trade name in a trademark sense to endorse or promote
|
||||||
|
products or services of Licensee, or any third party.
|
||||||
|
|
||||||
|
8. By copying, installing or otherwise using Python, Licensee
|
||||||
|
agrees to be bound by the terms and conditions of this License
|
||||||
|
Agreement.
|
||||||
@@ -1782,3 +1782,56 @@ releases:
|
|||||||
name: lxd_project
|
name: lxd_project
|
||||||
namespace: cloud.lxd
|
namespace: cloud.lxd
|
||||||
release_date: '2022-04-26'
|
release_date: '2022-04-26'
|
||||||
|
4.8.1:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
|
||||||
|
- consul - fixed bug where class ``ConsulService`` was overwriting the field
|
||||||
|
``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590).
|
||||||
|
- gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647).
|
||||||
|
- onepassword - search all valid configuration locations and use the first found
|
||||||
|
(https://github.com/ansible-collections/community.general/pull/4640).
|
||||||
|
- opentelemetry callback plugin - fix task message attribute that is reported
|
||||||
|
failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624).
|
||||||
|
- opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623).
|
||||||
|
- terraform - fix list initialization to support both Python 2 and Python 3
|
||||||
|
(https://github.com/ansible-collections/community.general/issues/4531).
|
||||||
|
release_summary: Regular bugfix release. From now on, only bugfix release will
|
||||||
|
be made of the community.general 4.x.y release stream.
|
||||||
|
fragments:
|
||||||
|
- 4.8.1.yml
|
||||||
|
- 4065-onepassword-config.yml
|
||||||
|
- 4590-consul-fix-service-checks.yaml
|
||||||
|
- 4621-terraform-py2-compat.yml
|
||||||
|
- 4623-opentelemetry_bug_fix_include_tasks.yml
|
||||||
|
- 4624-opentelemetry_bug_fix_hardcoded_value.yml
|
||||||
|
- 4647-gconftool2-command-arg.yaml
|
||||||
|
- psf-license.yml
|
||||||
|
release_date: '2022-05-16'
|
||||||
|
4.8.2:
|
||||||
|
changes:
|
||||||
|
bugfixes:
|
||||||
|
- Include ``simplified_bsd.txt`` license file for various module utils, the
|
||||||
|
``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
|
||||||
|
- consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680).
|
||||||
|
- filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700).
|
||||||
|
- filesystem - improve error messages when output cannot be parsed by including
|
||||||
|
newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700).
|
||||||
|
- gitlab_hook - avoid errors during idempotency check when an attribute does
|
||||||
|
not exist (https://github.com/ansible-collections/community.general/pull/4668).
|
||||||
|
- keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241).
|
||||||
|
- redis* modules - fix call to ``module.fail_json`` when failing because of
|
||||||
|
missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733).
|
||||||
|
- xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia
|
||||||
|
resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682).
|
||||||
|
release_summary: Regular maintenance and bugfix release.
|
||||||
|
fragments:
|
||||||
|
- 4.8.2.yml
|
||||||
|
- 4668-gitlab_hook-use-None-for-non-existent-attr.yml
|
||||||
|
- 4682-compatibility-virtualmedia-resource-location.yaml
|
||||||
|
- 4700-code-changes.yml
|
||||||
|
- 4712-consul-bugfix.yaml
|
||||||
|
- 4719-fix-keycloak-realm.yaml
|
||||||
|
- 4733-redis-fail.yml
|
||||||
|
- simplified-bsd-license.yml
|
||||||
|
release_date: '2022-06-06'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace: community
|
namespace: community
|
||||||
name: general
|
name: general
|
||||||
version: 4.8.0
|
version: 4.8.2
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- Ansible (https://github.com/ansible)
|
- Ansible (https://github.com/ansible)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ DOCUMENTATION = r'''
|
|||||||
version_added: 1.0.0
|
version_added: 1.0.0
|
||||||
default: ansible
|
default: ansible
|
||||||
pre_command:
|
pre_command:
|
||||||
description: Executes command before run and result put to ansible_pre_command_output field.
|
description: Executes command before run and its result is added to the C(ansible_pre_command_output) logstash field.
|
||||||
version_added: 2.0.0
|
version_added: 2.0.0
|
||||||
ini:
|
ini:
|
||||||
- section: callback_logstash
|
- section: callback_logstash
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ class OpenTelemetrySource(object):
|
|||||||
|
|
||||||
task = tasks_data[task_uuid]
|
task = tasks_data[task_uuid]
|
||||||
|
|
||||||
if self.ansible_version is None and result._task_fields['args'].get('_ansible_version'):
|
if self.ansible_version is None and hasattr(result, '_task_fields') and result._task_fields['args'].get('_ansible_version'):
|
||||||
self.ansible_version = result._task_fields['args'].get('_ansible_version')
|
self.ansible_version = result._task_fields['args'].get('_ansible_version')
|
||||||
|
|
||||||
task.add_host(HostData(host_uuid, host_name, status, result))
|
task.add_host(HostData(host_uuid, host_name, status, result))
|
||||||
@@ -258,8 +258,9 @@ class OpenTelemetrySource(object):
|
|||||||
else:
|
else:
|
||||||
res = host_data.result._result
|
res = host_data.result._result
|
||||||
rc = res.get('rc', 0)
|
rc = res.get('rc', 0)
|
||||||
message = self.get_error_message(res)
|
if host_data.status == 'failed':
|
||||||
enriched_error_message = self.enrich_error_message(res)
|
message = self.get_error_message(res)
|
||||||
|
enriched_error_message = self.enrich_error_message(res)
|
||||||
|
|
||||||
if host_data.status == 'failed':
|
if host_data.status == 'failed':
|
||||||
status = Status(status_code=StatusCode.ERROR, description=message)
|
status = Status(status_code=StatusCode.ERROR, description=message)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (C) 2017 Lenovo, Inc.
|
# Copyright (C) 2017 Lenovo, Inc.
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -5,6 +5,35 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: counter
|
||||||
|
short_description: Counts hashable elements in a sequence
|
||||||
|
version_added: 4.3.0
|
||||||
|
author: Rémy Keil (@keilr)
|
||||||
|
description:
|
||||||
|
- Counts hashable elements in a sequence.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A sequence.
|
||||||
|
type: list
|
||||||
|
elements: any
|
||||||
|
required: true
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Count occurences
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: >-
|
||||||
|
{{ [1, 'a', 2, 2, 'a', 'b', 'a'] | community.general.counter }}
|
||||||
|
# Produces: {1: 1, 'a': 3, 2: 2, 'b': 1}
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: A dictionary with the elements of the sequence as keys, and their number of occurance in the sequence as values.
|
||||||
|
type: dictionary
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible.errors import AnsibleFilterError
|
from ansible.errors import AnsibleFilterError
|
||||||
from ansible.module_utils.common._collections_compat import Sequence
|
from ansible.module_utils.common._collections_compat import Sequence
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|||||||
@@ -6,6 +6,60 @@
|
|||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: dict
|
||||||
|
short_description: Convert a list of tuples into a dictionary
|
||||||
|
version_added: 3.0.0
|
||||||
|
author: Felix Fontein (@felixfontein)
|
||||||
|
description:
|
||||||
|
- Convert a list of tuples into a dictionary. This is a filter version of the C(dict) function.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of tuples (with exactly two elements).
|
||||||
|
type: list
|
||||||
|
elements: tuple
|
||||||
|
required: true
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Convert list of tuples into dictionary
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
dictionary: "{{ [[1, 2], ['a', 'b']] | community.general.dict }}"
|
||||||
|
# Result is {1: 2, 'a': 'b'}
|
||||||
|
|
||||||
|
- name: Create a list of dictionaries with map and the community.general.dict filter
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: >-
|
||||||
|
{{ values | map('zip', ['k1', 'k2', 'k3'])
|
||||||
|
| map('map', 'reverse')
|
||||||
|
| map('community.general.dict') }}
|
||||||
|
vars:
|
||||||
|
values:
|
||||||
|
- - foo
|
||||||
|
- 23
|
||||||
|
- a
|
||||||
|
- - bar
|
||||||
|
- 42
|
||||||
|
- b
|
||||||
|
# Produces the following list of dictionaries:
|
||||||
|
# {
|
||||||
|
# "k1": "foo",
|
||||||
|
# "k2": 23,
|
||||||
|
# "k3": "a"
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "k1": "bar",
|
||||||
|
# "k2": 42,
|
||||||
|
# "k3": "b"
|
||||||
|
# }
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The dictionary having the provided key-value pairs.
|
||||||
|
type: boolean
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
def dict_filter(sequence):
|
def dict_filter(sequence):
|
||||||
'''Convert a list of tuples to a dictionary.
|
'''Convert a list of tuples to a dictionary.
|
||||||
|
|||||||
@@ -5,6 +5,38 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: dict_kv
|
||||||
|
short_description: Convert a value to a dictionary with a single key-value pair
|
||||||
|
version_added: 1.3.0
|
||||||
|
author: Stanislav German-Evtushenko (@giner)
|
||||||
|
description:
|
||||||
|
- Convert a value to a dictionary with a single key-value pair.
|
||||||
|
positional: key
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: The value for the single key-value pair.
|
||||||
|
type: any
|
||||||
|
required: true
|
||||||
|
key:
|
||||||
|
description: The key for the single key-value pair.
|
||||||
|
type: any
|
||||||
|
required: true
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Create a one-element dictionary from a value
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ 'myvalue' | dict_kv('mykey') }}"
|
||||||
|
# Produces the dictionary {'mykey': 'myvalue'}
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: A dictionary with a single key-value pair.
|
||||||
|
type: dictionary
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
def dict_kv(value, key):
|
def dict_kv(value, key):
|
||||||
'''Return a dictionary with a single key-value pair
|
'''Return a dictionary with a single key-value pair
|
||||||
|
|||||||
@@ -7,6 +7,78 @@
|
|||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: from_csv
|
||||||
|
short_description: Converts CSV text input into list of dicts
|
||||||
|
version_added: 2.3.0
|
||||||
|
author: Andrew Pantuso (@Ajpantuso)
|
||||||
|
description:
|
||||||
|
- Converts CSV text input into list of dictionaries.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A string containing a CSV document.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
dialect:
|
||||||
|
description:
|
||||||
|
- The CSV dialect to use when parsing the CSV file.
|
||||||
|
- Possible values include C(excel), C(excel-tab) or C(unix).
|
||||||
|
type: str
|
||||||
|
default: excel
|
||||||
|
fieldnames:
|
||||||
|
description:
|
||||||
|
- A list of field names for every column.
|
||||||
|
- This is needed if the CSV does not have a header.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
delimiter:
|
||||||
|
description:
|
||||||
|
- A one-character string used to separate fields.
|
||||||
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
|
- The default value depends on the dialect used.
|
||||||
|
type: str
|
||||||
|
skipinitialspace:
|
||||||
|
description:
|
||||||
|
- Whether to ignore any whitespaces immediately following the delimiter.
|
||||||
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
|
- The default value depends on the dialect used.
|
||||||
|
type: bool
|
||||||
|
strict:
|
||||||
|
description:
|
||||||
|
- Whether to raise an exception on bad CSV input.
|
||||||
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
|
- The default value depends on the dialect used.
|
||||||
|
type: bool
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Parse a CSV file's contents
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: >-
|
||||||
|
{{ csv_data | community.genera.from_csv(dialect='unix') }}
|
||||||
|
vars:
|
||||||
|
csv_data: |
|
||||||
|
Column 1,Value
|
||||||
|
foo,23
|
||||||
|
bar,42
|
||||||
|
# Produces the following list of dictionaries:
|
||||||
|
# {
|
||||||
|
# "Column 1": "foo",
|
||||||
|
# "Value": "23",
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "Column 1": "bar",
|
||||||
|
# "Value": "42",
|
||||||
|
# }
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: A list with one dictionary per row.
|
||||||
|
type: list
|
||||||
|
elements: dictionary
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible.errors import AnsibleFilterError
|
from ansible.errors import AnsibleFilterError
|
||||||
from ansible.module_utils.common.text.converters import to_native
|
from ansible.module_utils.common.text.converters import to_native
|
||||||
|
|
||||||
|
|||||||
42
plugins/filter/groupby_as_dict.yml
Normal file
42
plugins/filter/groupby_as_dict.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: groupby_as_dict
|
||||||
|
short_description: Transform a sequence of dictionaries to a dictionary where the dictionaries are indexed by an attribute
|
||||||
|
version_added: 3.1.0
|
||||||
|
author: Felix Fontein (@felixfontein)
|
||||||
|
description:
|
||||||
|
- Transform a sequence of dictionaries to a dictionary where the dictionaries are indexed by an attribute.
|
||||||
|
positional: attribute
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of dictionaries
|
||||||
|
type: list
|
||||||
|
elements: dictionary
|
||||||
|
required: true
|
||||||
|
attribute:
|
||||||
|
description: The attribute to use as the key.
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Arrange a list of dictionaries as a dictionary of dictionaries
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ sequence | community.general.groupby_as_dict('key') }}"
|
||||||
|
vars:
|
||||||
|
sequence:
|
||||||
|
- key: value
|
||||||
|
foo: bar
|
||||||
|
- key: other_value
|
||||||
|
baz: bar
|
||||||
|
# Produces the following nested structure:
|
||||||
|
#
|
||||||
|
# value:
|
||||||
|
# key: value
|
||||||
|
# foo: bar
|
||||||
|
# other_value:
|
||||||
|
# key: other_value
|
||||||
|
# baz: bar
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: A dictionary containing the dictionaries from the list as values.
|
||||||
|
type: dictionary
|
||||||
38
plugins/filter/hashids_decode.yml
Normal file
38
plugins/filter/hashids_decode.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: hashids_decode
|
||||||
|
short_description: Decodes a sequence of numbers from a YouTube-like hash
|
||||||
|
version_added: 3.0.0
|
||||||
|
author: Andrew Pantuso (@Ajpantuso)
|
||||||
|
description:
|
||||||
|
- Decodes a sequence of numbers from a YouTube-like hash.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A YouTube-like hash.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
salt:
|
||||||
|
description:
|
||||||
|
- String to use as salt when hashing.
|
||||||
|
type: str
|
||||||
|
default: excel
|
||||||
|
alphabet:
|
||||||
|
description:
|
||||||
|
- String of 16 or more unique characters to produce a hash.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
min_length:
|
||||||
|
description:
|
||||||
|
- Minimum length of hash produced.
|
||||||
|
type: integer
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert hash to list of integers
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ 'o2fXhV' | community.general.hashids_decode }}"
|
||||||
|
# Produces: [1, 2, 3]
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: A list of integers.
|
||||||
|
type: list
|
||||||
|
elements: integer
|
||||||
38
plugins/filter/hashids_encode.yml
Normal file
38
plugins/filter/hashids_encode.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: hashids_encode
|
||||||
|
short_description: Encodes YouTube-like hashes from a sequence of integers
|
||||||
|
version_added: 3.0.0
|
||||||
|
author: Andrew Pantuso (@Ajpantuso)
|
||||||
|
description:
|
||||||
|
- Encodes YouTube-like hashes from a sequence of integers.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of integers.
|
||||||
|
type: list
|
||||||
|
elements: integer
|
||||||
|
required: true
|
||||||
|
salt:
|
||||||
|
description:
|
||||||
|
- String to use as salt when hashing.
|
||||||
|
type: str
|
||||||
|
default: excel
|
||||||
|
alphabet:
|
||||||
|
description:
|
||||||
|
- String of 16 or more unique characters to produce a hash.
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
|
min_length:
|
||||||
|
description:
|
||||||
|
- Minimum length of hash produced.
|
||||||
|
type: integer
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert list of integers to hash
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ [1, 2, 3] | community.general.hashids_encode }}"
|
||||||
|
# Produces: 'o2fXhV'
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: A YouTube-like hash.
|
||||||
|
type: string
|
||||||
@@ -21,6 +21,67 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: jc
|
||||||
|
short_description: Convert output of many shell commands and file-types to JSON
|
||||||
|
version_added: 1.1.0
|
||||||
|
author: Kelly Brazil (@kellyjonbrazil)
|
||||||
|
description:
|
||||||
|
- Convert output of many shell commands and file-types to JSON.
|
||||||
|
- Uses the L(jc library,https://github.com/kellyjonbrazil/jc).
|
||||||
|
positional: parser
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: The data to convert.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
parser:
|
||||||
|
description:
|
||||||
|
- The correct parser for the input data.
|
||||||
|
- For exmaple C(ifconfig).
|
||||||
|
- See U(https://github.com/kellyjonbrazil/jc#parsers) for the latest list of parsers.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
quiet:
|
||||||
|
description: Set to C(false) to not suppress warnings.
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
raw:
|
||||||
|
description: Set to C(true) to return pre-processed JSON.
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
requirements:
|
||||||
|
- jc (https://github.com/kellyjonbrazil/jc)
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Run command
|
||||||
|
ansible.builtin.command: uname -a
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Convert command's result to JSON
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ result.stdout | community.general.jc('uname') }}"
|
||||||
|
# Possible output:
|
||||||
|
#
|
||||||
|
# "msg": {
|
||||||
|
# "hardware_platform": "x86_64",
|
||||||
|
# "kernel_name": "Linux",
|
||||||
|
# "kernel_release": "4.15.0-112-generic",
|
||||||
|
# "kernel_version": "#113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020",
|
||||||
|
# "machine": "x86_64",
|
||||||
|
# "node_name": "kbrazil-ubuntu",
|
||||||
|
# "operating_system": "GNU/Linux",
|
||||||
|
# "processor": "x86_64"
|
||||||
|
# }
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The processed output.
|
||||||
|
type: any
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleFilterError
|
from ansible.errors import AnsibleError, AnsibleFilterError
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,107 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: json_query
|
||||||
|
short_description: Select a single element or a data subset from a complex data structure
|
||||||
|
description:
|
||||||
|
- This filter lets you query a complex JSON structure and iterate over it using a loop structure.
|
||||||
|
positional: expr
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The JSON data to query.
|
||||||
|
type: any
|
||||||
|
required: true
|
||||||
|
expr:
|
||||||
|
description:
|
||||||
|
- The query expression.
|
||||||
|
- See U(http://jmespath.org/examples.html) for examples.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
requirements:
|
||||||
|
- jmespath
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Define data to work on in the examples below
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
domain_definition:
|
||||||
|
domain:
|
||||||
|
cluster:
|
||||||
|
- name: cluster1
|
||||||
|
- name: cluster2
|
||||||
|
server:
|
||||||
|
- name: server11
|
||||||
|
cluster: cluster1
|
||||||
|
port: '8080'
|
||||||
|
- name: server12
|
||||||
|
cluster: cluster1
|
||||||
|
port: '8090'
|
||||||
|
- name: server21
|
||||||
|
cluster: cluster2
|
||||||
|
port: '9080'
|
||||||
|
- name: server22
|
||||||
|
cluster: cluster2
|
||||||
|
port: '9090'
|
||||||
|
library:
|
||||||
|
- name: lib1
|
||||||
|
target: cluster1
|
||||||
|
- name: lib2
|
||||||
|
target: cluster2
|
||||||
|
|
||||||
|
- name: Display all cluster names
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: item
|
||||||
|
loop: "{{ domain_definition | community.general.json_query('domain.cluster[*].name') }}"
|
||||||
|
|
||||||
|
- name: Display all server names
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: item
|
||||||
|
loop: "{{ domain_definition | community.general.json_query('domain.server[*].name') }}"
|
||||||
|
|
||||||
|
- name: Display all ports from cluster1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: item
|
||||||
|
loop: "{{ domain_definition | community.general.json_query(server_name_cluster1_query) }}"
|
||||||
|
vars:
|
||||||
|
server_name_cluster1_query: "domain.server[?cluster=='cluster1'].port"
|
||||||
|
|
||||||
|
- name: Display all ports from cluster1 as a string
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ domain_definition | community.general.json_query('domain.server[?cluster==`cluster1`].port') | join(', ') }}"
|
||||||
|
|
||||||
|
- name: Display all ports from cluster1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: item
|
||||||
|
loop: "{{ domain_definition | community.general.json_query('domain.server[?cluster==''cluster1''].port') }}"
|
||||||
|
|
||||||
|
- name: Display all server ports and names from cluster1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: item
|
||||||
|
loop: "{{ domain_definition | community.general.json_query(server_name_cluster1_query) }}"
|
||||||
|
vars:
|
||||||
|
server_name_cluster1_query: "domain.server[?cluster=='cluster2'].{name: name, port: port}"
|
||||||
|
|
||||||
|
- name: Display all ports from cluster1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ domain_definition | to_json | from_json | community.general.json_query(server_name_query) }}"
|
||||||
|
vars:
|
||||||
|
server_name_query: "domain.server[?starts_with(name,'server1')].port"
|
||||||
|
|
||||||
|
- name: Display all ports from cluster1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ domain_definition | to_json | from_json | community.general.json_query(server_name_query) }}"
|
||||||
|
vars:
|
||||||
|
server_name_query: "domain.server[?contains(name,'server1')].port"
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The result of the query.
|
||||||
|
type: any
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleFilterError
|
from ansible.errors import AnsibleError, AnsibleFilterError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
88
plugins/filter/lists_mergeby.yml
Normal file
88
plugins/filter/lists_mergeby.yml
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: lists_mergeby
|
||||||
|
short_description: Merge two or more lists of dictionaries by a given attribute
|
||||||
|
version_added: 2.0.0
|
||||||
|
author: Vladimir Botka (@vbotka)
|
||||||
|
description:
|
||||||
|
- Merge two or more lists by attribute I(index). Optional parameters 'recursive' and 'list_merge'
|
||||||
|
control the merging of the lists in values. The function merge_hash from ansible.utils.vars
|
||||||
|
is used. To learn details on how to use the parameters 'recursive' and 'list_merge' see
|
||||||
|
Ansible User's Guide chapter "Using filters to manipulate data" section "Combining
|
||||||
|
hashes/dictionaries".
|
||||||
|
positional: another_list, index
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of dictionaries.
|
||||||
|
type: list
|
||||||
|
elements: dictionary
|
||||||
|
required: true
|
||||||
|
another_list:
|
||||||
|
description: Another list of dictionaries. This parameter can be specified multiple times.
|
||||||
|
type: list
|
||||||
|
elements: dictionary
|
||||||
|
index:
|
||||||
|
description:
|
||||||
|
- The dictionary key that must be present in every dictionary in every list that is used to
|
||||||
|
merge the lists.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
recursive:
|
||||||
|
description:
|
||||||
|
- Should the combine recursively merge nested dictionaries (hashes).
|
||||||
|
- "B(Note:) It does not depend on the value of the C(hash_behaviour) setting in C(ansible.cfg)."
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
list_merge:
|
||||||
|
description:
|
||||||
|
- Modifies the behaviour when the dictionaries (hashes) to merge contain arrays/lists.
|
||||||
|
type: string
|
||||||
|
default: replace
|
||||||
|
choices:
|
||||||
|
- replace
|
||||||
|
- keep
|
||||||
|
- append
|
||||||
|
- prepend
|
||||||
|
- append_rp
|
||||||
|
- prepend_rp
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Merge two lists
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: >-
|
||||||
|
{{ list1 | community.general.lists_mergeby(
|
||||||
|
list2,
|
||||||
|
'index',
|
||||||
|
recursive=True,
|
||||||
|
list_merge='append'
|
||||||
|
) }}"
|
||||||
|
vars:
|
||||||
|
list1:
|
||||||
|
- index: a
|
||||||
|
value: 123
|
||||||
|
- index: b
|
||||||
|
value: 42
|
||||||
|
list2:
|
||||||
|
- index: a
|
||||||
|
foo: bar
|
||||||
|
- index: c
|
||||||
|
foo: baz
|
||||||
|
# Produces the following list of dictionaries:
|
||||||
|
# {
|
||||||
|
# "index": "a",
|
||||||
|
# "foo": "bar",
|
||||||
|
# "value": 123
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "index": "b",
|
||||||
|
# "value": 42
|
||||||
|
# },
|
||||||
|
# {
|
||||||
|
# "index": "c",
|
||||||
|
# "foo": "baz"
|
||||||
|
# }
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: The merged list.
|
||||||
|
type: list
|
||||||
|
elements: dictionary
|
||||||
@@ -20,6 +20,41 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: random_mac
|
||||||
|
short_description: Generate a random MAC address
|
||||||
|
description:
|
||||||
|
- Generates random networking interfaces MAC addresses for a given prefix.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A string prefix to use as a basis for the random MAC generated.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
seed:
|
||||||
|
description:
|
||||||
|
- A randomization seed to initialize the process, used to get repeatable results.
|
||||||
|
- If no seed is provided, a system random source such as C(/dev/urandom) is used.
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Random MAC given a prefix
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '52:54:00' | community.general.random_mac }}"
|
||||||
|
# => '52:54:00:ef:1c:03'
|
||||||
|
|
||||||
|
- name: With a seed
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '52:54:00' | community.general.random_mac(seed=inventory_hostname) }}"
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The generated MAC.
|
||||||
|
type: string
|
||||||
|
'''
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from random import Random, SystemRandom
|
from random import Random, SystemRandom
|
||||||
|
|
||||||
|
|||||||
40
plugins/filter/to_days.yml
Normal file
40
plugins/filter/to_days.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_days
|
||||||
|
short_description: Converte a duration string to days
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to days.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into days
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '1y 7m 5d 30h' | community.general.to_days }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of days.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_hours.yml
Normal file
40
plugins/filter/to_hours.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_hours
|
||||||
|
short_description: Converte a duration string to hours
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to hours.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into hours
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '7d 30h 20m 10s 123ms' | community.general.to_hours }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of hours.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_milliseconds.yml
Normal file
40
plugins/filter/to_milliseconds.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_milliseconds
|
||||||
|
short_description: Converte a duration string to milliseconds
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to milliseconds.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into milliseconds
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '30h 20m 10s 123ms' | community.general.to_milliseconds }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of milliseconds.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_minutes.yml
Normal file
40
plugins/filter/to_minutes.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_minutes
|
||||||
|
short_description: Converte a duration string to minutes
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to minutes.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into minutes
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '30h 20m 10s 123ms' | community.general.to_minutes }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of minutes.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_months.yml
Normal file
40
plugins/filter/to_months.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_months
|
||||||
|
short_description: Converte a duration string to months
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to months.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into months
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '1y 7m 5d 30h' | community.general.to_months }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of months.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_seconds.yml
Normal file
40
plugins/filter/to_seconds.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_seconds
|
||||||
|
short_description: Converte a duration string to seconds
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to seconds.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into seconds
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '30h 20m 10s 123ms' | community.general.to_seconds }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of seconds.
|
||||||
|
type: float
|
||||||
84
plugins/filter/to_time_unit.yml
Normal file
84
plugins/filter/to_time_unit.yml
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_time_unit
|
||||||
|
short_description: Converte a duration string to the given time unit
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to the given time unit.
|
||||||
|
positional: unit
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
unit:
|
||||||
|
description:
|
||||||
|
- Time unit to convert the duration to.
|
||||||
|
default: ms
|
||||||
|
choices:
|
||||||
|
- millisecond
|
||||||
|
- milliseconds
|
||||||
|
- ms
|
||||||
|
- msec
|
||||||
|
- msecs
|
||||||
|
- msecond
|
||||||
|
- mseconds
|
||||||
|
- s
|
||||||
|
- sec
|
||||||
|
- secs
|
||||||
|
- second
|
||||||
|
- seconds
|
||||||
|
- h
|
||||||
|
- hour
|
||||||
|
- hours
|
||||||
|
- hs
|
||||||
|
- m
|
||||||
|
- min
|
||||||
|
- mins
|
||||||
|
- minute
|
||||||
|
- minutes
|
||||||
|
- d
|
||||||
|
- ds
|
||||||
|
- day
|
||||||
|
- days
|
||||||
|
- w
|
||||||
|
- ws
|
||||||
|
- week
|
||||||
|
- weeks
|
||||||
|
- mo
|
||||||
|
- mos
|
||||||
|
- month
|
||||||
|
- months
|
||||||
|
- y
|
||||||
|
- ys
|
||||||
|
- year
|
||||||
|
- years
|
||||||
|
type: string
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into seconds
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '1053d 17h 53m -10s 391ms' | community.general.to_time_unit('s') }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of time units.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_weeks.yml
Normal file
40
plugins/filter/to_weeks.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_weeks
|
||||||
|
short_description: Converte a duration string to weeks
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to weeks.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into weeks
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '1y 7m 5d 30h' | community.general.to_weeks }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of weeks.
|
||||||
|
type: float
|
||||||
40
plugins/filter/to_years.yml
Normal file
40
plugins/filter/to_years.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: to_years
|
||||||
|
short_description: Converte a duration string to years
|
||||||
|
version_added: 0.2.0
|
||||||
|
description:
|
||||||
|
- Parse a human readable time duration string and convert to years.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description:
|
||||||
|
- The time string to convert.
|
||||||
|
- Can use the units C(y) and C(year) for a year, C(mo) and C(month) for a month, C(w) and C(week) for a week,
|
||||||
|
C(d) and C(day) for a day, C(h) and C(hour) for a hour, C(m), C(min) and C(minute) for minutes, C(s), C(sec)
|
||||||
|
and C(second) for seconds, C(ms), C(msec), C(msecond) and C(millisecond) for milliseconds. The suffix C(s)
|
||||||
|
can be added to a unit as well, so C(seconds) is the same as C(second).
|
||||||
|
- Valid strings are space separated combinations of an integer with an optional minus sign and a unit.
|
||||||
|
- Examples are C(1h), C(-5m), and C(3h -5m 6s).
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
year:
|
||||||
|
description:
|
||||||
|
- Number of days per year.
|
||||||
|
default: 365
|
||||||
|
type: float
|
||||||
|
month:
|
||||||
|
description:
|
||||||
|
- Number of days per month.
|
||||||
|
default: 30
|
||||||
|
type: float
|
||||||
|
author:
|
||||||
|
- René Moser (@resmo)
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
- name: Convert a duration into years
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ '1053d 30h' | community.general.to_years }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: Number of years.
|
||||||
|
type: float
|
||||||
@@ -6,6 +6,46 @@
|
|||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: unicode_normalize
|
||||||
|
short_description: Normalizes unicode strings to facilitate comparison of characters with normalized forms
|
||||||
|
version_added: 3.7.0
|
||||||
|
author: Andrew Pantuso (@Ajpantuso)
|
||||||
|
description:
|
||||||
|
- Normalizes unicode strings to facilitate comparison of characters with normalized forms.
|
||||||
|
positional: form
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A unicode string.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
form:
|
||||||
|
description:
|
||||||
|
- The normal form to use.
|
||||||
|
- See U(https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize) for details.
|
||||||
|
type: string
|
||||||
|
default: NFC
|
||||||
|
choices:
|
||||||
|
- NFC
|
||||||
|
- NFD
|
||||||
|
- NFKC
|
||||||
|
- NFKD
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Normalize unicode string
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
dictionary: "{{ 'ä' | community.general.unicode_normalize('NFKD') }}"
|
||||||
|
# The resulting string has length 2: one letter is 'a', the other
|
||||||
|
# the diacritic combiner.
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The normalized unicode string of the specified normal form.
|
||||||
|
type: string
|
||||||
|
'''
|
||||||
|
|
||||||
from unicodedata import normalize
|
from unicodedata import normalize
|
||||||
|
|
||||||
from ansible.errors import AnsibleFilterError, AnsibleFilterTypeError
|
from ansible.errors import AnsibleFilterError, AnsibleFilterTypeError
|
||||||
|
|||||||
@@ -5,6 +5,35 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: version_sort
|
||||||
|
short_description: Sort a list according to version order instead of pure alphabetical one
|
||||||
|
version_added: 2.2.0
|
||||||
|
author: Eric L. (@ericzolf)
|
||||||
|
description:
|
||||||
|
- Sort a list according to version order instead of pure alphabetical one.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of strings to sort.
|
||||||
|
type: list
|
||||||
|
elements: string
|
||||||
|
required: true
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Convert list of tuples into dictionary
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
dictionary: "{{ ['2.1', '2.10', '2.9'] | community.general.version_sort }}"
|
||||||
|
# Result is ['2.1', '2.9', '2.10']
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: The list of strings sorted by version.
|
||||||
|
type: list
|
||||||
|
elements: string
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,14 +57,19 @@ EXAMPLES = """
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
password:
|
_result:
|
||||||
description:
|
description: A list containing one dictionary.
|
||||||
- The actual value stored
|
type: list
|
||||||
passprops:
|
elements: dictionary
|
||||||
description: properties assigned to the entry
|
contains:
|
||||||
type: dictionary
|
password:
|
||||||
passwordchangeinprocess:
|
description:
|
||||||
description: did the password change?
|
- The actual value stored
|
||||||
|
passprops:
|
||||||
|
description: properties assigned to the entry
|
||||||
|
type: dictionary
|
||||||
|
passwordchangeinprocess:
|
||||||
|
description: did the password change?
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ DOCUMENTATION = '''
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name : output secrets to screen (BAD IDEA)
|
- name: output secrets to screen (BAD IDEA)
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "Password: {{item}}"
|
msg: "Password: {{item}}"
|
||||||
with_community.general.keyring:
|
with_community.general.keyring:
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ DOCUMENTATION = '''
|
|||||||
description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults.
|
description: Vault containing the item to retrieve (case-insensitive). If absent will search all vaults.
|
||||||
notes:
|
notes:
|
||||||
- This lookup will use an existing 1Password session if one exists. If not, and you have already
|
- This lookup will use an existing 1Password session if one exists. If not, and you have already
|
||||||
performed an initial sign in (meaning C(~/.op/config exists)), then only the C(master_password) is required.
|
performed an initial sign in (meaning C(~/.op/config), C(~/.config/op/config) or C(~/.config/.op/config) exists), then only the
|
||||||
You may optionally specify C(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op).
|
C(master_password) is required. You may optionally specify C(subdomain) in this scenario, otherwise the last used subdomain will be used by C(op).
|
||||||
- This lookup can perform an initial login by providing C(subdomain), C(username), C(secret_key), and C(master_password).
|
- This lookup can perform an initial login by providing C(subdomain), C(username), C(secret_key), and C(master_password).
|
||||||
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials
|
- Due to the B(very) sensitive nature of these credentials, it is B(highly) recommended that you only pass in the minimal credentials
|
||||||
needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength
|
needed at any given time. Also, store these credentials in an Ansible Vault using a key that is equal to or greater in strength
|
||||||
@@ -105,12 +105,12 @@ from ansible.plugins.lookup import LookupBase
|
|||||||
from ansible.errors import AnsibleLookupError
|
from ansible.errors import AnsibleLookupError
|
||||||
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
||||||
|
|
||||||
|
from ansible_collections.community.general.plugins.module_utils.onepassword import OnePasswordConfig
|
||||||
|
|
||||||
|
|
||||||
class OnePass(object):
|
class OnePass(object):
|
||||||
|
|
||||||
def __init__(self, path='op'):
|
def __init__(self, path='op'):
|
||||||
self.cli_path = path
|
self.cli_path = path
|
||||||
self.config_file_path = os.path.expanduser('~/.op/config')
|
|
||||||
self.logged_in = False
|
self.logged_in = False
|
||||||
self.token = None
|
self.token = None
|
||||||
self.subdomain = None
|
self.subdomain = None
|
||||||
@@ -119,9 +119,11 @@ class OnePass(object):
|
|||||||
self.secret_key = None
|
self.secret_key = None
|
||||||
self.master_password = None
|
self.master_password = None
|
||||||
|
|
||||||
|
self._config = OnePasswordConfig()
|
||||||
|
|
||||||
def get_token(self):
|
def get_token(self):
|
||||||
# If the config file exists, assume an initial signin has taken place and try basic sign in
|
# If the config file exists, assume an initial signin has taken place and try basic sign in
|
||||||
if os.path.isfile(self.config_file_path):
|
if os.path.isfile(self._config.config_file_path):
|
||||||
|
|
||||||
if not self.master_password:
|
if not self.master_password:
|
||||||
raise AnsibleLookupError('Unable to sign in to 1Password. master_password is required.')
|
raise AnsibleLookupError('Unable to sign in to 1Password. master_password is required.')
|
||||||
@@ -281,4 +283,5 @@ class LookupModule(LookupBase):
|
|||||||
values = []
|
values = []
|
||||||
for term in terms:
|
for term in terms:
|
||||||
values.append(op.get_field(term, field, section, vault))
|
values.append(op.get_field(term, field, section, vault))
|
||||||
|
|
||||||
return values
|
return values
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Implements multiple version numbering conventions for the
|
# Implements multiple version numbering conventions for the
|
||||||
# Python Module Distribution Utilities.
|
# Python Module Distribution Utilities.
|
||||||
#
|
#
|
||||||
# PSF License (see licenses/PSF-license.txt or https://opensource.org/licenses/Python-2.0)
|
# PSF License (see PSF-license.txt or https://opensource.org/licenses/Python-2.0)
|
||||||
#
|
#
|
||||||
|
|
||||||
"""Provides classes to represent module version numbers (one class for
|
"""Provides classes to represent module version numbers (one class for
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
|
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
# Copyright (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright: (c) 2019 Gregory Thiemonge <gregory.thiemonge@gmail.com>
|
# Copyright: (c) 2019 Gregory Thiemonge <gregory.thiemonge@gmail.com>
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright: (c) 2018, Ansible Project
|
# Copyright: (c) 2018, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c), Google Inc, 2017
|
# Copyright (c), Google Inc, 2017
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or
|
# Simplified BSD License (see simplified_bsd.txt or
|
||||||
# https://opensource.org/licenses/BSD-2-Clause)
|
# https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Copyright (C) 2018 IBM CORPORATION
|
# Copyright (C) 2018 IBM CORPORATION
|
||||||
# Author(s): Tzur Eliyahu <tzure@il.ibm.com>
|
# Author(s): Tzur Eliyahu <tzure@il.ibm.com>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright: (c) 2017, Ansible Project
|
# Copyright: (c) 2017, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2016 Thomas Krahn (@Nosmoht)
|
# Copyright (c) 2016 Thomas Krahn (@Nosmoht)
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c), Luke Murphy @decentral1se
|
# Copyright (c), Luke Murphy @decentral1se
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# still belong to the author of the module, and may assign their own license
|
# still belong to the author of the module, and may assign their own license
|
||||||
# to the complete work.
|
# to the complete work.
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# still belong to the author of the module, and may assign their own license
|
# still belong to the author of the module, and may assign their own license
|
||||||
# to the complete work.
|
# to the complete work.
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
|
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
# (c) 2020, Alexei Znamensky <russoz@gmail.com>
|
||||||
# Copyright: (c) 2020, Ansible Project
|
# Copyright: (c) 2020, Ansible Project
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# still belong to the author of the module, and may assign their own license
|
# still belong to the author of the module, and may assign their own license
|
||||||
# to the complete work.
|
# to the complete work.
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
29
plugins/module_utils/onepassword.py
Normal file
29
plugins/module_utils/onepassword.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
class OnePasswordConfig(object):
|
||||||
|
_config_file_paths = (
|
||||||
|
"~/.op/config",
|
||||||
|
"~/.config/op/config",
|
||||||
|
"~/.config/.op/config",
|
||||||
|
)
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self._config_file_path = ""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def config_file_path(self):
|
||||||
|
if self._config_file_path:
|
||||||
|
return self._config_file_path
|
||||||
|
|
||||||
|
for path in self._config_file_paths:
|
||||||
|
realpath = os.path.expanduser(path)
|
||||||
|
if os.path.exists(realpath):
|
||||||
|
self._config_file_path = realpath
|
||||||
|
return self._config_file_path
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
|
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2018 www.privaz.io Valletech AB
|
# Copyright 2018 www.privaz.io Valletech AB
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
# to the complete work.
|
# to the complete work.
|
||||||
#
|
#
|
||||||
# Copyright (c), Simon Dodsley <simon@purestorage.com>,2017
|
# Copyright (c), Simon Dodsley <simon@purestorage.com>,2017
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c), James Laska
|
# Copyright (c), James Laska
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def fail_imports(module, needs_certifi=True):
|
|||||||
errors.append(missing_required_lib('certifi'))
|
errors.append(missing_required_lib('certifi'))
|
||||||
traceback.append(CERTIFI_IMPORT_ERROR)
|
traceback.append(CERTIFI_IMPORT_ERROR)
|
||||||
if errors:
|
if errors:
|
||||||
module.fail_json(errors=errors, traceback='\n'.join(traceback))
|
module.fail_json(msg='\n'.join(errors), traceback='\n'.join(traceback))
|
||||||
|
|
||||||
|
|
||||||
def redis_auth_argument_spec(tls_default=True):
|
def redis_auth_argument_spec(tls_default=True):
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# own license to the complete work.
|
# own license to the complete work.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017 Lenovo, Inc.
|
# Copyright (C) 2017 Lenovo, Inc.
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
#
|
#
|
||||||
# Contains LXCA common class
|
# Contains LXCA common class
|
||||||
# Lenovo xClarity Administrator (LXCA)
|
# Lenovo xClarity Administrator (LXCA)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# Copyright: (c) 2020, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
|
# Copyright: (c) 2020, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# (c) 2018 Luca 'remix_tj' Lorenzetto
|
# (c) 2018 Luca 'remix_tj' Lorenzetto
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
|
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
# Copyright (c) 2016, Adfinis SyGroup AG
|
# Copyright (c) 2016, Adfinis SyGroup AG
|
||||||
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
|
# Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
|
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
|
||||||
#
|
#
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright: (c) 2019, Sandeep Kasargod <sandeep@vexata.com>
|
# Copyright: (c) 2019, Sandeep Kasargod <sandeep@vexata.com>
|
||||||
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
# Simplified BSD License (see simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ def build_plan(command, project_path, variables_args, state_file, targets, state
|
|||||||
if plan_path is None:
|
if plan_path is None:
|
||||||
f, plan_path = tempfile.mkstemp(suffix='.tfplan')
|
f, plan_path = tempfile.mkstemp(suffix='.tfplan')
|
||||||
|
|
||||||
local_command = command.copy()
|
local_command = command[:]
|
||||||
|
|
||||||
plan_command = [command[0], 'plan']
|
plan_command = [command[0], 'plan']
|
||||||
|
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ def add_service(module, service):
|
|||||||
service_id=result.id,
|
service_id=result.id,
|
||||||
service_name=result.name,
|
service_name=result.name,
|
||||||
service_port=result.port,
|
service_port=result.port,
|
||||||
checks=[check.to_dict() for check in service.checks],
|
checks=[check.to_dict() for check in service.checks()],
|
||||||
tags=result.tags)
|
tags=result.tags)
|
||||||
|
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ class ConsulService(object):
|
|||||||
self.address = address
|
self.address = address
|
||||||
self.port = port
|
self.port = port
|
||||||
self.tags = tags
|
self.tags = tags
|
||||||
self.checks = []
|
self._checks = []
|
||||||
if loaded:
|
if loaded:
|
||||||
self.id = loaded['ID']
|
self.id = loaded['ID']
|
||||||
self.name = loaded['Service']
|
self.name = loaded['Service']
|
||||||
@@ -424,8 +424,8 @@ class ConsulService(object):
|
|||||||
if self.port:
|
if self.port:
|
||||||
optional['port'] = self.port
|
optional['port'] = self.port
|
||||||
|
|
||||||
if len(self.checks) > 0:
|
if len(self._checks) > 0:
|
||||||
optional['check'] = self.checks[0].check
|
optional['check'] = self._checks[0].check
|
||||||
|
|
||||||
consul_api.agent.service.register(
|
consul_api.agent.service.register(
|
||||||
self.name,
|
self.name,
|
||||||
@@ -435,13 +435,13 @@ class ConsulService(object):
|
|||||||
**optional)
|
**optional)
|
||||||
|
|
||||||
def add_check(self, check):
|
def add_check(self, check):
|
||||||
self.checks.append(check)
|
self._checks.append(check)
|
||||||
|
|
||||||
def checks(self):
|
def checks(self):
|
||||||
return self.checks
|
return self._checks
|
||||||
|
|
||||||
def has_checks(self):
|
def has_checks(self):
|
||||||
return len(self.checks) > 0
|
return len(self._checks) > 0
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return (isinstance(other, self.__class__) and
|
return (isinstance(other, self.__class__) and
|
||||||
@@ -459,8 +459,8 @@ class ConsulService(object):
|
|||||||
data['port'] = self.port
|
data['port'] = self.port
|
||||||
if self.tags and len(self.tags) > 0:
|
if self.tags and len(self.tags) > 0:
|
||||||
data['tags'] = self.tags
|
data['tags'] = self.tags
|
||||||
if len(self.checks) > 0:
|
if len(self._checks) > 0:
|
||||||
data['check'] = self.checks[0].to_dict()
|
data['check'] = self._checks[0].to_dict()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,19 +48,19 @@ options:
|
|||||||
delimiter:
|
delimiter:
|
||||||
description:
|
description:
|
||||||
- A one-character string used to separate fields.
|
- A one-character string used to separate fields.
|
||||||
- When using this parameter, you change the default value used by C(dialect).
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
- The default value depends on the dialect used.
|
- The default value depends on the dialect used.
|
||||||
type: str
|
type: str
|
||||||
skipinitialspace:
|
skipinitialspace:
|
||||||
description:
|
description:
|
||||||
- Whether to ignore any whitespaces immediately following the delimiter.
|
- Whether to ignore any whitespaces immediately following the delimiter.
|
||||||
- When using this parameter, you change the default value used by C(dialect).
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
- The default value depends on the dialect used.
|
- The default value depends on the dialect used.
|
||||||
type: bool
|
type: bool
|
||||||
strict:
|
strict:
|
||||||
description:
|
description:
|
||||||
- Whether to raise an exception on bad CSV input.
|
- Whether to raise an exception on bad CSV input.
|
||||||
- When using this parameter, you change the default value used by C(dialect).
|
- When using this parameter, you change the default value used by I(dialect).
|
||||||
- The default value depends on the dialect used.
|
- The default value depends on the dialect used.
|
||||||
type: bool
|
type: bool
|
||||||
notes:
|
notes:
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ options:
|
|||||||
aliases:
|
aliases:
|
||||||
- defaultGroups
|
- defaultGroups
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: str
|
||||||
default_locale:
|
default_locale:
|
||||||
description:
|
description:
|
||||||
- The realm default locale.
|
- The realm default locale.
|
||||||
@@ -183,7 +183,7 @@ options:
|
|||||||
aliases:
|
aliases:
|
||||||
- defaultRoles
|
- defaultRoles
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: str
|
||||||
default_signature_algorithm:
|
default_signature_algorithm:
|
||||||
description:
|
description:
|
||||||
- The realm default signature algorithm.
|
- The realm default signature algorithm.
|
||||||
@@ -622,10 +622,10 @@ def main():
|
|||||||
client_authentication_flow=dict(type='str', aliases=['clientAuthenticationFlow']),
|
client_authentication_flow=dict(type='str', aliases=['clientAuthenticationFlow']),
|
||||||
client_scope_mappings=dict(type='dict', aliases=['clientScopeMappings']),
|
client_scope_mappings=dict(type='dict', aliases=['clientScopeMappings']),
|
||||||
default_default_client_scopes=dict(type='list', elements='str', aliases=['defaultDefaultClientScopes']),
|
default_default_client_scopes=dict(type='list', elements='str', aliases=['defaultDefaultClientScopes']),
|
||||||
default_groups=dict(type='list', elements='dict', aliases=['defaultGroups']),
|
default_groups=dict(type='list', elements='str', aliases=['defaultGroups']),
|
||||||
default_locale=dict(type='str', aliases=['defaultLocale']),
|
default_locale=dict(type='str', aliases=['defaultLocale']),
|
||||||
default_optional_client_scopes=dict(type='list', elements='str', aliases=['defaultOptionalClientScopes']),
|
default_optional_client_scopes=dict(type='list', elements='str', aliases=['defaultOptionalClientScopes']),
|
||||||
default_roles=dict(type='list', elements='dict', aliases=['defaultRoles']),
|
default_roles=dict(type='list', elements='str', aliases=['defaultRoles']),
|
||||||
default_signature_algorithm=dict(type='str', aliases=['defaultSignatureAlgorithm']),
|
default_signature_algorithm=dict(type='str', aliases=['defaultSignatureAlgorithm']),
|
||||||
direct_grant_flow=dict(type='str', aliases=['directGrantFlow']),
|
direct_grant_flow=dict(type='str', aliases=['directGrantFlow']),
|
||||||
display_name=dict(type='str', aliases=['displayName']),
|
display_name=dict(type='str', aliases=['displayName']),
|
||||||
|
|||||||
@@ -166,6 +166,8 @@ from subprocess import Popen, PIPE
|
|||||||
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
from ansible_collections.community.general.plugins.module_utils.onepassword import OnePasswordConfig
|
||||||
|
|
||||||
|
|
||||||
class AnsibleModuleError(Exception):
|
class AnsibleModuleError(Exception):
|
||||||
def __init__(self, results):
|
def __init__(self, results):
|
||||||
@@ -179,7 +181,6 @@ class OnePasswordInfo(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.cli_path = module.params.get('cli_path')
|
self.cli_path = module.params.get('cli_path')
|
||||||
self.config_file_path = '~/.op/config'
|
|
||||||
self.auto_login = module.params.get('auto_login')
|
self.auto_login = module.params.get('auto_login')
|
||||||
self.logged_in = False
|
self.logged_in = False
|
||||||
self.token = None
|
self.token = None
|
||||||
@@ -187,6 +188,8 @@ class OnePasswordInfo(object):
|
|||||||
terms = module.params.get('search_terms')
|
terms = module.params.get('search_terms')
|
||||||
self.terms = self.parse_search_terms(terms)
|
self.terms = self.parse_search_terms(terms)
|
||||||
|
|
||||||
|
self._config = OnePasswordConfig()
|
||||||
|
|
||||||
def _run(self, args, expected_rc=0, command_input=None, ignore_errors=False):
|
def _run(self, args, expected_rc=0, command_input=None, ignore_errors=False):
|
||||||
if self.token:
|
if self.token:
|
||||||
# Adds the session token to all commands if we're logged in.
|
# Adds the session token to all commands if we're logged in.
|
||||||
@@ -299,7 +302,7 @@ class OnePasswordInfo(object):
|
|||||||
|
|
||||||
def get_token(self):
|
def get_token(self):
|
||||||
# If the config file exists, assume an initial signin has taken place and try basic sign in
|
# If the config file exists, assume an initial signin has taken place and try basic sign in
|
||||||
if os.path.isfile(self.config_file_path):
|
if os.path.isfile(self._config.config_file_path):
|
||||||
|
|
||||||
if self.auto_login is not None:
|
if self.auto_login is not None:
|
||||||
|
|
||||||
|
|||||||
@@ -157,8 +157,8 @@ options:
|
|||||||
version_added: 2.0.0
|
version_added: 2.0.0
|
||||||
dns4:
|
dns4:
|
||||||
description:
|
description:
|
||||||
- A list of up to 3 dns servers.
|
- A list of up to 3 DNS servers.
|
||||||
- IPv4 format e.g. to add two IPv4 DNS server addresses, use C(192.0.2.53 198.51.100.53).
|
- The entries must be IPv4 addresses, for example C(192.0.2.53).
|
||||||
elements: str
|
elements: str
|
||||||
type: list
|
type: list
|
||||||
dns4_search:
|
dns4_search:
|
||||||
@@ -255,8 +255,8 @@ options:
|
|||||||
version_added: 4.4.0
|
version_added: 4.4.0
|
||||||
dns6:
|
dns6:
|
||||||
description:
|
description:
|
||||||
- A list of up to 3 dns servers.
|
- A list of up to 3 DNS servers.
|
||||||
- IPv6 format e.g. to add two IPv6 DNS server addresses, use C(2001:4860:4860::8888 2001:4860:4860::8844).
|
- The entries must be IPv6 addresses, for example C(2001:4860:4860::8888).
|
||||||
elements: str
|
elements: str
|
||||||
type: list
|
type: list
|
||||||
dns6_search:
|
dns6_search:
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ class XCCRedfishUtils(RedfishUtils):
|
|||||||
continue
|
continue
|
||||||
if 'RDOC' in uri:
|
if 'RDOC' in uri:
|
||||||
continue
|
continue
|
||||||
|
if 'Remote' in uri:
|
||||||
|
continue
|
||||||
# if ejected, 'Inserted' should be False and 'ImageName' cleared
|
# if ejected, 'Inserted' should be False and 'ImageName' cleared
|
||||||
if (not data.get('Inserted', False) and
|
if (not data.get('Inserted', False) and
|
||||||
not data.get('ImageName')):
|
not data.get('ImageName')):
|
||||||
@@ -312,13 +314,19 @@ class XCCRedfishUtils(RedfishUtils):
|
|||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
def virtual_media_eject_one(self, image_url):
|
def virtual_media_eject_one(self, image_url):
|
||||||
# locate and read the VirtualMedia resources
|
# read the VirtualMedia resources from systems
|
||||||
response = self.get_request(self.root_uri + self.manager_uri)
|
response = self.get_request(self.root_uri + self.systems_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
data = response['data']
|
||||||
if 'VirtualMedia' not in data:
|
if 'VirtualMedia' not in data:
|
||||||
return {'ret': False, 'msg': "VirtualMedia resource not found"}
|
# read the VirtualMedia resources from manager
|
||||||
|
response = self.get_request(self.root_uri + self.manager_uri)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
data = response['data']
|
||||||
|
if 'VirtualMedia' not in data:
|
||||||
|
return {'ret': False, 'msg': "VirtualMedia resource not found"}
|
||||||
virt_media_uri = data["VirtualMedia"]["@odata.id"]
|
virt_media_uri = data["VirtualMedia"]["@odata.id"]
|
||||||
response = self.get_request(self.root_uri + virt_media_uri)
|
response = self.get_request(self.root_uri + virt_media_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
@@ -379,13 +387,20 @@ class XCCRedfishUtils(RedfishUtils):
|
|||||||
return self.virtual_media_eject_one(image_url)
|
return self.virtual_media_eject_one(image_url)
|
||||||
|
|
||||||
# eject all inserted media when no image_url specified
|
# eject all inserted media when no image_url specified
|
||||||
# read all the VirtualMedia resources
|
# read the VirtualMedia resources from systems
|
||||||
response = self.get_request(self.root_uri + self.manager_uri)
|
response = self.get_request(self.root_uri + self.systems_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
data = response['data']
|
||||||
if 'VirtualMedia' not in data:
|
if 'VirtualMedia' not in data:
|
||||||
return {'ret': False, 'msg': "VirtualMedia resource not found"}
|
# read the VirtualMedia resources from manager
|
||||||
|
response = self.get_request(self.root_uri + self.manager_uri)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
data = response['data']
|
||||||
|
if 'VirtualMedia' not in data:
|
||||||
|
return {'ret': False, 'msg': "VirtualMedia resource not found"}
|
||||||
|
# read all the VirtualMedia resources
|
||||||
virt_media_uri = data["VirtualMedia"]["@odata.id"]
|
virt_media_uri = data["VirtualMedia"]["@odata.id"]
|
||||||
response = self.get_request(self.root_uri + virt_media_uri)
|
response = self.get_request(self.root_uri + virt_media_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
@@ -413,6 +428,95 @@ class XCCRedfishUtils(RedfishUtils):
|
|||||||
return {'ret': True, 'changed': True,
|
return {'ret': True, 'changed': True,
|
||||||
'msg': "VirtualMedia %s ejected" % str(ejected_media_list)}
|
'msg': "VirtualMedia %s ejected" % str(ejected_media_list)}
|
||||||
|
|
||||||
|
def virtual_media_insert(self, options):
|
||||||
|
param_map = {
|
||||||
|
'Inserted': 'inserted',
|
||||||
|
'WriteProtected': 'write_protected',
|
||||||
|
'UserName': 'username',
|
||||||
|
'Password': 'password',
|
||||||
|
'TransferProtocolType': 'transfer_protocol_type',
|
||||||
|
'TransferMethod': 'transfer_method'
|
||||||
|
}
|
||||||
|
image_url = options.get('image_url')
|
||||||
|
if not image_url:
|
||||||
|
return {'ret': False,
|
||||||
|
'msg': "image_url option required for VirtualMediaInsert"}
|
||||||
|
media_types = options.get('media_types')
|
||||||
|
|
||||||
|
# read the VirtualMedia resources from systems
|
||||||
|
response = self.get_request(self.root_uri + self.systems_uri)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
data = response['data']
|
||||||
|
if 'VirtualMedia' not in data:
|
||||||
|
# read the VirtualMedia resources from manager
|
||||||
|
response = self.get_request(self.root_uri + self.manager_uri)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
data = response['data']
|
||||||
|
if 'VirtualMedia' not in data:
|
||||||
|
return {'ret': False, 'msg': "VirtualMedia resource not found"}
|
||||||
|
virt_media_uri = data["VirtualMedia"]["@odata.id"]
|
||||||
|
response = self.get_request(self.root_uri + virt_media_uri)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
data = response['data']
|
||||||
|
virt_media_list = []
|
||||||
|
for member in data[u'Members']:
|
||||||
|
virt_media_list.append(member[u'@odata.id'])
|
||||||
|
resources, headers = self._read_virt_media_resources(virt_media_list)
|
||||||
|
|
||||||
|
# see if image already inserted; if so, nothing to do
|
||||||
|
if self._virt_media_image_inserted(resources, image_url):
|
||||||
|
return {'ret': True, 'changed': False,
|
||||||
|
'msg': "VirtualMedia '%s' already inserted" % image_url}
|
||||||
|
|
||||||
|
# find an empty slot to insert the media
|
||||||
|
# try first with strict media_type matching
|
||||||
|
uri, data = self._find_empty_virt_media_slot(
|
||||||
|
resources, media_types, media_match_strict=True)
|
||||||
|
if not uri:
|
||||||
|
# if not found, try without strict media_type matching
|
||||||
|
uri, data = self._find_empty_virt_media_slot(
|
||||||
|
resources, media_types, media_match_strict=False)
|
||||||
|
if not uri:
|
||||||
|
return {'ret': False,
|
||||||
|
'msg': "Unable to find an available VirtualMedia resource "
|
||||||
|
"%s" % ('supporting ' + str(media_types)
|
||||||
|
if media_types else '')}
|
||||||
|
|
||||||
|
# confirm InsertMedia action found
|
||||||
|
if ('Actions' not in data or
|
||||||
|
'#VirtualMedia.InsertMedia' not in data['Actions']):
|
||||||
|
# try to insert via PATCH if no InsertMedia action found
|
||||||
|
h = headers[uri]
|
||||||
|
if 'allow' in h:
|
||||||
|
methods = [m.strip() for m in h.get('allow').split(',')]
|
||||||
|
if 'PATCH' not in methods:
|
||||||
|
# if Allow header present and PATCH missing, return error
|
||||||
|
return {'ret': False,
|
||||||
|
'msg': "%s action not found and PATCH not allowed"
|
||||||
|
% '#VirtualMedia.InsertMedia'}
|
||||||
|
return self.virtual_media_insert_via_patch(options, param_map,
|
||||||
|
uri, data)
|
||||||
|
|
||||||
|
# get the action property
|
||||||
|
action = data['Actions']['#VirtualMedia.InsertMedia']
|
||||||
|
if 'target' not in action:
|
||||||
|
return {'ret': False,
|
||||||
|
'msg': "target URI missing from Action "
|
||||||
|
"#VirtualMedia.InsertMedia"}
|
||||||
|
action_uri = action['target']
|
||||||
|
# get ActionInfo or AllowableValues
|
||||||
|
ai = self._get_all_action_info_values(action)
|
||||||
|
# construct payload
|
||||||
|
payload = self._insert_virt_media_payload(options, param_map, data, ai)
|
||||||
|
# POST to action
|
||||||
|
response = self.post_request(self.root_uri + action_uri, payload)
|
||||||
|
if response['ret'] is False:
|
||||||
|
return response
|
||||||
|
return {'ret': True, 'changed': True, 'msg': "VirtualMedia inserted"}
|
||||||
|
|
||||||
def raw_get_resource(self, resource_uri):
|
def raw_get_resource(self, resource_uri):
|
||||||
if resource_uri is None:
|
if resource_uri is None:
|
||||||
return {'ret': False, 'msg': "resource_uri is missing"}
|
return {'ret': False, 'msg': "resource_uri is missing"}
|
||||||
@@ -640,7 +744,11 @@ def main():
|
|||||||
|
|
||||||
# Organize by Categories / Commands
|
# Organize by Categories / Commands
|
||||||
if category == "Manager":
|
if category == "Manager":
|
||||||
# execute only if we find a Manager service resource
|
# For virtual media resource locates on Systems service
|
||||||
|
result = rf_utils._find_systems_resource()
|
||||||
|
if result['ret'] is False:
|
||||||
|
module.fail_json(msg=to_native(result['msg']))
|
||||||
|
# For virtual media resource locates on Managers service
|
||||||
result = rf_utils._find_managers_resource()
|
result = rf_utils._find_managers_resource()
|
||||||
if result['ret'] is False:
|
if result['ret'] is False:
|
||||||
module.fail_json(msg=to_native(result['msg']))
|
module.fail_json(msg=to_native(result['msg']))
|
||||||
|
|||||||
@@ -14,46 +14,46 @@ short_description: Manages Out-Of-Band controllers using iDRAC OEM Redfish APIs
|
|||||||
description:
|
description:
|
||||||
- Builds Redfish URIs locally and sends them to remote OOB controllers to
|
- Builds Redfish URIs locally and sends them to remote OOB controllers to
|
||||||
perform an action.
|
perform an action.
|
||||||
- For use with Dell iDRAC operations that require Redfish OEM extensions
|
- For use with Dell iDRAC operations that require Redfish OEM extensions.
|
||||||
options:
|
options:
|
||||||
category:
|
category:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Category to execute on OOB controller
|
- Category to execute on iDRAC.
|
||||||
type: str
|
type: str
|
||||||
command:
|
command:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on iDRAC.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of OOB controller
|
- Base URI of iDRAC.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with OOB controller
|
- Username for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with OOB controller
|
- Password for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to OOB controller
|
- Timeout in seconds for HTTP requests to iDRAC.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
resource_id:
|
resource_id:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The ID of the System, Manager or Chassis to modify
|
- ID of the System, Manager or Chassis to modify.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
|
|
||||||
|
|||||||
@@ -20,50 +20,50 @@ options:
|
|||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Category to execute on iDRAC
|
- Category to execute on iDRAC.
|
||||||
command:
|
command:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on iDRAC
|
- List of commands to execute on iDRAC.
|
||||||
- I(SetManagerAttributes), I(SetLifecycleControllerAttributes) and
|
- I(SetManagerAttributes), I(SetLifecycleControllerAttributes) and
|
||||||
I(SetSystemAttributes) are mutually exclusive commands when C(category)
|
I(SetSystemAttributes) are mutually exclusive commands when C(category)
|
||||||
is I(Manager)
|
is I(Manager).
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of iDRAC
|
- Base URI of iDRAC.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with iDRAC
|
- Username for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with iDRAC
|
- Password for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
manager_attributes:
|
manager_attributes:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- dictionary of iDRAC attribute name and value pairs to update
|
- Dictionary of iDRAC attribute name and value pairs to update.
|
||||||
default: {}
|
default: {}
|
||||||
type: 'dict'
|
type: 'dict'
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to iDRAC controller
|
- Timeout in seconds for HTTP requests to iDRAC.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
resource_id:
|
resource_id:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The ID of the System, Manager or Chassis to modify
|
- ID of the System, Manager or Chassis to modify.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
|
|
||||||
|
|||||||
@@ -14,44 +14,44 @@ short_description: Gather PowerEdge server information through iDRAC using Redfi
|
|||||||
description:
|
description:
|
||||||
- Builds Redfish URIs locally and sends them to remote iDRAC controllers to
|
- Builds Redfish URIs locally and sends them to remote iDRAC controllers to
|
||||||
get information back.
|
get information back.
|
||||||
- For use with Dell EMC iDRAC operations that require Redfish OEM extensions
|
- For use with Dell EMC iDRAC operations that require Redfish OEM extensions.
|
||||||
- This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts).
|
- This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts).
|
||||||
Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)!
|
Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)!
|
||||||
options:
|
options:
|
||||||
category:
|
category:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Category to execute on iDRAC controller
|
- Category to execute on iDRAC.
|
||||||
type: str
|
type: str
|
||||||
command:
|
command:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on iDRAC controller
|
- List of commands to execute on iDRAC.
|
||||||
- C(GetManagerAttributes) returns the list of dicts containing iDRAC,
|
- C(GetManagerAttributes) returns the list of dicts containing iDRAC,
|
||||||
LifecycleController and System attributes
|
LifecycleController and System attributes.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of iDRAC controller
|
- Base URI of iDRAC.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with iDRAC controller
|
- Username for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with iDRAC controller
|
- Password for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to iDRAC.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to OOB controller
|
- Timeout in seconds for HTTP requests to iDRAC.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
|
|
||||||
|
|||||||
@@ -34,19 +34,19 @@ options:
|
|||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with iLO.
|
- Username for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with iLO.
|
- Password for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller.
|
- Security token for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to iLO controller.
|
- Timeout in seconds for HTTP requests to iLO.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
attribute_name:
|
attribute_name:
|
||||||
@@ -82,6 +82,17 @@ EXAMPLES = '''
|
|||||||
password: Testpass123
|
password: Testpass123
|
||||||
attribute_name: TimeZone
|
attribute_name: TimeZone
|
||||||
attribute_value: Chennai
|
attribute_value: Chennai
|
||||||
|
|
||||||
|
- name: Set NTP Servers
|
||||||
|
community.general.ilo_redfish_config:
|
||||||
|
category: Manager
|
||||||
|
command: SetNTPServers
|
||||||
|
baseuri: 15.X.X.X
|
||||||
|
username: Admin
|
||||||
|
password: Testpass123
|
||||||
|
attribute_name: StaticNTPServers
|
||||||
|
attribute_value: X.X.X.X
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|||||||
@@ -34,19 +34,19 @@ options:
|
|||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with iLO.
|
- Username for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with iLO.
|
- Password for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with iLO.
|
- Security token for authenticating to iLO.
|
||||||
type: str
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to iLO.
|
- Timeout in seconds for HTTP requests to iLO.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
author:
|
author:
|
||||||
|
|||||||
@@ -21,35 +21,35 @@ options:
|
|||||||
category:
|
category:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Category to execute on OOB controller
|
- Category to execute on OOB controller.
|
||||||
type: str
|
type: str
|
||||||
command:
|
command:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of OOB controller
|
- Base URI of OOB controller.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- Username for authentication with OOB controller
|
- Username for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with OOB controller
|
- Password for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
session_uri:
|
session_uri:
|
||||||
description:
|
description:
|
||||||
- URI of the session resource
|
- URI of the session resource.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
id:
|
id:
|
||||||
@@ -63,28 +63,28 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
aliases: [ account_username ]
|
aliases: [ account_username ]
|
||||||
description:
|
description:
|
||||||
- Username of account to add/delete/modify
|
- Username of account to add/delete/modify.
|
||||||
type: str
|
type: str
|
||||||
new_password:
|
new_password:
|
||||||
required: false
|
required: false
|
||||||
aliases: [ account_password ]
|
aliases: [ account_password ]
|
||||||
description:
|
description:
|
||||||
- New password of account to add/modify
|
- New password of account to add/modify.
|
||||||
type: str
|
type: str
|
||||||
roleid:
|
roleid:
|
||||||
required: false
|
required: false
|
||||||
aliases: [ account_roleid ]
|
aliases: [ account_roleid ]
|
||||||
description:
|
description:
|
||||||
- Role of account to add/modify
|
- Role of account to add/modify.
|
||||||
type: str
|
type: str
|
||||||
bootdevice:
|
bootdevice:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- bootdevice when setting boot configuration
|
- Boot device when setting boot configuration.
|
||||||
type: str
|
type: str
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to OOB controller
|
- Timeout in seconds for HTTP requests to OOB controller.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
boot_override_mode:
|
boot_override_mode:
|
||||||
@@ -96,117 +96,117 @@ options:
|
|||||||
uefi_target:
|
uefi_target:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- UEFI target when bootdevice is "UefiTarget"
|
- UEFI boot target when bootdevice is "UefiTarget".
|
||||||
type: str
|
type: str
|
||||||
boot_next:
|
boot_next:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- BootNext target when bootdevice is "UefiBootNext"
|
- BootNext target when bootdevice is "UefiBootNext".
|
||||||
type: str
|
type: str
|
||||||
update_username:
|
update_username:
|
||||||
required: false
|
required: false
|
||||||
aliases: [ account_updatename ]
|
aliases: [ account_updatename ]
|
||||||
description:
|
description:
|
||||||
- new update user name for account_username
|
- New user name for updating account_username.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
account_properties:
|
account_properties:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- properties of account service to update
|
- Properties of account service to update.
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
resource_id:
|
resource_id:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The ID of the System, Manager or Chassis to modify
|
- ID of the System, Manager or Chassis to modify.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
update_image_uri:
|
update_image_uri:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The URI of the image for the update
|
- URI of the image for the update.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
update_protocol:
|
update_protocol:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The protocol for the update
|
- Protocol for the update.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
update_targets:
|
update_targets:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The list of target resource URIs to apply the update to
|
- List of target resource URIs to apply the update to.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
update_creds:
|
update_creds:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The credentials for retrieving the update image
|
- Credentials for retrieving the update image.
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
suboptions:
|
suboptions:
|
||||||
username:
|
username:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The username for retrieving the update image
|
- Username for retrieving the update image.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The password for retrieving the update image
|
- Password for retrieving the update image.
|
||||||
type: str
|
type: str
|
||||||
virtual_media:
|
virtual_media:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The options for VirtualMedia commands
|
- Options for VirtualMedia commands.
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
suboptions:
|
suboptions:
|
||||||
media_types:
|
media_types:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The list of media types appropriate for the image
|
- List of media types appropriate for the image.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
image_url:
|
image_url:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The URL od the image the insert or eject
|
- URL of the image to insert or eject.
|
||||||
type: str
|
type: str
|
||||||
inserted:
|
inserted:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- Indicates if the image is treated as inserted on command completion
|
- Indicates that the image is treated as inserted on command completion.
|
||||||
type: bool
|
type: bool
|
||||||
default: True
|
default: True
|
||||||
write_protected:
|
write_protected:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- Indicates if the media is treated as write-protected
|
- Indicates that the media is treated as write-protected.
|
||||||
type: bool
|
type: bool
|
||||||
default: True
|
default: True
|
||||||
username:
|
username:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The username for accessing the image URL
|
- Username for accessing the image URL.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The password for accessing the image URL
|
- Password for accessing the image URL.
|
||||||
type: str
|
type: str
|
||||||
transfer_protocol_type:
|
transfer_protocol_type:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The network protocol to use with the image
|
- Network protocol to use with the image.
|
||||||
type: str
|
type: str
|
||||||
transfer_method:
|
transfer_method:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The transfer method to use with the image
|
- Transfer method to use with the image.
|
||||||
type: str
|
type: str
|
||||||
strip_etag_quotes:
|
strip_etag_quotes:
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -20,48 +20,48 @@ options:
|
|||||||
category:
|
category:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Category to execute on OOB controller
|
- Category to execute on OOB controller.
|
||||||
type: str
|
type: str
|
||||||
command:
|
command:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of OOB controller
|
- Base URI of OOB controller.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with OOB controller
|
- Username for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with OOB controller
|
- Password for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
bios_attributes:
|
bios_attributes:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- dictionary of BIOS attributes to update
|
- Dictionary of BIOS attributes to update.
|
||||||
default: {}
|
default: {}
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to OOB controller
|
- Timeout in seconds for HTTP requests to OOB controller.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
boot_order:
|
boot_order:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- list of BootOptionReference strings specifying the BootOrder
|
- List of BootOptionReference strings specifying the BootOrder.
|
||||||
default: []
|
default: []
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
@@ -69,26 +69,26 @@ options:
|
|||||||
network_protocols:
|
network_protocols:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- setting dict of manager services to update
|
- Setting dict of manager services to update.
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
resource_id:
|
resource_id:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- The ID of the System, Manager or Chassis to modify
|
- ID of the System, Manager or Chassis to modify.
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
nic_addr:
|
nic_addr:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- EthernetInterface Address string on OOB controller
|
- EthernetInterface Address string on OOB controller.
|
||||||
default: 'null'
|
default: 'null'
|
||||||
type: str
|
type: str
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
nic_config:
|
nic_config:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- setting dict of EthernetInterface on OOB controller
|
- Setting dict of EthernetInterface on OOB controller.
|
||||||
type: dict
|
type: dict
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
strip_etag_quotes:
|
strip_etag_quotes:
|
||||||
|
|||||||
@@ -21,37 +21,37 @@ options:
|
|||||||
category:
|
category:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- List of categories to execute on OOB controller
|
- List of categories to execute on OOB controller.
|
||||||
default: ['Systems']
|
default: ['Systems']
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
command:
|
command:
|
||||||
required: false
|
required: false
|
||||||
description:
|
description:
|
||||||
- List of commands to execute on OOB controller
|
- List of commands to execute on OOB controller.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
baseuri:
|
baseuri:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- Base URI of OOB controller
|
- Base URI of OOB controller.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- User for authentication with OOB controller
|
- Username for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- Password for authentication with OOB controller
|
- Password for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
auth_token:
|
auth_token:
|
||||||
description:
|
description:
|
||||||
- Security token for authentication with OOB controller
|
- Security token for authenticating to OOB controller.
|
||||||
type: str
|
type: str
|
||||||
version_added: 2.3.0
|
version_added: 2.3.0
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Timeout in seconds for URL requests to OOB controller
|
- Timeout in seconds for HTTP requests to OOB controller.
|
||||||
default: 10
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class GitLabHook(object):
|
|||||||
|
|
||||||
for arg_key, arg_value in arguments.items():
|
for arg_key, arg_value in arguments.items():
|
||||||
if arguments[arg_key] is not None:
|
if arguments[arg_key] is not None:
|
||||||
if getattr(hook, arg_key) != arguments[arg_key]:
|
if getattr(hook, arg_key, None) != arguments[arg_key]:
|
||||||
setattr(hook, arg_key, arguments[arg_key])
|
setattr(hook, arg_key, arguments[arg_key])
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ class Ext(Filesystem):
|
|||||||
if None not in (block_size, block_count):
|
if None not in (block_size, block_count):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise ValueError(out)
|
raise ValueError(repr(out))
|
||||||
|
|
||||||
return block_size * block_count
|
return block_size * block_count
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ class XFS(Filesystem):
|
|||||||
if None not in (block_size, block_count):
|
if None not in (block_size, block_count):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise ValueError(out)
|
raise ValueError(repr(out))
|
||||||
|
|
||||||
return block_size * block_count
|
return block_size * block_count
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ class Btrfs(Filesystem):
|
|||||||
for line in stdout.splitlines():
|
for line in stdout.splitlines():
|
||||||
if "Device size" in line:
|
if "Device size" in line:
|
||||||
return int(line.split()[-1])
|
return int(line.split()[-1])
|
||||||
raise ValueError(stdout)
|
raise ValueError(repr(stdout))
|
||||||
|
|
||||||
|
|
||||||
class Ocfs2(Filesystem):
|
class Ocfs2(Filesystem):
|
||||||
@@ -405,7 +405,7 @@ class F2fs(Filesystem):
|
|||||||
if None not in (sector_size, sector_count):
|
if None not in (sector_size, sector_count):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise ValueError(out)
|
raise ValueError(repr(out))
|
||||||
|
|
||||||
return sector_size * sector_count
|
return sector_size * sector_count
|
||||||
|
|
||||||
@@ -428,12 +428,15 @@ class VFAT(Filesystem):
|
|||||||
dummy, out, dummy = self.module.run_command([cmd, '--info', str(dev)], check_rc=True, environ_update=self.LANG_ENV)
|
dummy, out, dummy = self.module.run_command([cmd, '--info', str(dev)], check_rc=True, environ_update=self.LANG_ENV)
|
||||||
fssize = None
|
fssize = None
|
||||||
for line in out.splitlines()[1:]:
|
for line in out.splitlines()[1:]:
|
||||||
param, value = line.split(':', 1)
|
parts = line.split(':', 1)
|
||||||
if param.strip() == 'Size':
|
if len(parts) < 2:
|
||||||
|
continue
|
||||||
|
param, value = parts
|
||||||
|
if param.strip() in ('Size', 'Cur size'):
|
||||||
fssize = int(value.strip())
|
fssize = int(value.strip())
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise ValueError(out)
|
raise ValueError(repr(out))
|
||||||
|
|
||||||
return fssize
|
return fssize
|
||||||
|
|
||||||
@@ -477,7 +480,7 @@ class UFS(Filesystem):
|
|||||||
if None not in (fragmentsize, providersize):
|
if None not in (fragmentsize, providersize):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise ValueError(out)
|
raise ValueError(repr(out))
|
||||||
|
|
||||||
return fragmentsize * providersize
|
return fragmentsize * providersize
|
||||||
|
|
||||||
|
|||||||
@@ -99,45 +99,41 @@ class GConf2Preference(object):
|
|||||||
|
|
||||||
def call(self, call_type, fail_onerr=True):
|
def call(self, call_type, fail_onerr=True):
|
||||||
""" Helper function to perform gconftool-2 operations """
|
""" Helper function to perform gconftool-2 operations """
|
||||||
config_source = ''
|
config_source = []
|
||||||
direct = ''
|
direct = []
|
||||||
changed = False
|
changed = False
|
||||||
out = ''
|
out = ''
|
||||||
|
|
||||||
# If the configuration source is different from the default, create
|
# If the configuration source is different from the default, create
|
||||||
# the argument
|
# the argument
|
||||||
if self.config_source is not None and len(self.config_source) > 0:
|
if self.config_source is not None and len(self.config_source) > 0:
|
||||||
config_source = "--config-source " + self.config_source
|
config_source = ["--config-source", self.config_source]
|
||||||
|
|
||||||
# If direct is true, create the argument
|
# If direct is true, create the argument
|
||||||
if self.direct:
|
if self.direct:
|
||||||
direct = "--direct"
|
direct = ["--direct"]
|
||||||
|
|
||||||
# Execute the call
|
# Execute the call
|
||||||
cmd = "gconftool-2 "
|
cmd = ["gconftool-2"]
|
||||||
try:
|
try:
|
||||||
# If the call is "get", then we don't need as many parameters and
|
# If the call is "get", then we don't need as many parameters and
|
||||||
# we can ignore some
|
# we can ignore some
|
||||||
if call_type == 'get':
|
if call_type == 'get':
|
||||||
cmd += "--get {0}".format(self.key)
|
cmd.extend(["--get", self.key])
|
||||||
# Otherwise, we will use all relevant parameters
|
# Otherwise, we will use all relevant parameters
|
||||||
elif call_type == 'set':
|
elif call_type == 'set':
|
||||||
cmd += "{0} {1} --type {2} --{3} {4} \"{5}\"".format(direct,
|
cmd.extend(direct)
|
||||||
config_source,
|
cmd.extend(config_source)
|
||||||
self.value_type,
|
cmd.extend(["--type", self.value_type, "--{3}".format(call_type), self.key, self.value])
|
||||||
call_type,
|
|
||||||
self.key,
|
|
||||||
self.value)
|
|
||||||
elif call_type == 'unset':
|
elif call_type == 'unset':
|
||||||
cmd += "--unset {0}".format(self.key)
|
cmd.extend(["--unset", self.key])
|
||||||
|
|
||||||
# Start external command
|
# Start external command
|
||||||
rc, out, err = self.ansible.run_command(cmd, use_unsafe_shell=True)
|
rc, out, err = self.ansible.run_command(cmd)
|
||||||
|
|
||||||
if len(err) > 0:
|
if err and fail_onerr:
|
||||||
if fail_onerr:
|
self.ansible.fail_json(msg='gconftool-2 failed with '
|
||||||
self.ansible.fail_json(msg='gconftool-2 failed with '
|
'error: %s' % (str(err)))
|
||||||
'error: %s' % (str(err)))
|
|
||||||
else:
|
else:
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,39 @@
|
|||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
DOCUMENTATION = '''
|
||||||
|
name: a_module
|
||||||
|
short_description: Test whether a given string refers to an existing module or action plugin
|
||||||
|
version_added: 4.0.0
|
||||||
|
author: Felix Fontein (@felixfontein)
|
||||||
|
description:
|
||||||
|
- Test whether a given string refers to an existing module or action plugin.
|
||||||
|
- This can be useful in roles, which can use this to ensure that required modules are present ahead of time.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A string denoting a fully qualified collection name (FQCN) of a module or action plugin.
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
- name: Make sure that community.aws.route53 is available
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- >
|
||||||
|
'community.aws.route53' is community.general.a_module
|
||||||
|
|
||||||
|
- name: Make sure that community.general.does_not_exist is not a module or action plugin
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- "'community.general.does_not_exist' is not community.general.a_module"
|
||||||
|
'''
|
||||||
|
|
||||||
|
RETURN = '''
|
||||||
|
_value:
|
||||||
|
description: Whether the module or action plugin denoted by the input exists.
|
||||||
|
type: boolean
|
||||||
|
'''
|
||||||
|
|
||||||
from ansible.plugins.loader import action_loader, module_loader
|
from ansible.plugins.loader import action_loader, module_loader
|
||||||
|
|
||||||
|
|||||||
8
simplified_bsd.txt
Normal file
8
simplified_bsd.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
@@ -7,8 +7,18 @@
|
|||||||
- set_fact:
|
- set_fact:
|
||||||
has_cargo: true
|
has_cargo: true
|
||||||
when:
|
when:
|
||||||
- ansible_system != 'FreeBSD' or ansible_distribution_version is version('13.0', '>')
|
- ansible_system != 'FreeBSD'
|
||||||
- ansible_distribution != 'MacOSX'
|
- ansible_distribution != 'MacOSX'
|
||||||
- ansible_distribution != 'RedHat' or ansible_distribution_version is version('8.0', '>=')
|
- ansible_distribution != 'RedHat' or ansible_distribution_version is version('8.0', '>=')
|
||||||
- ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=')
|
- ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=')
|
||||||
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('18', '>=')
|
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('18', '>=')
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Install rust (containing cargo)
|
||||||
|
package:
|
||||||
|
name: rust
|
||||||
|
state: present
|
||||||
|
- set_fact:
|
||||||
|
has_cargo: true
|
||||||
|
when:
|
||||||
|
- ansible_system == 'FreeBSD' and ansible_distribution_version is version('13.0', '>')
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
when:
|
when:
|
||||||
- not (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int == 14)
|
- not (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int == 14)
|
||||||
- not (ansible_os_family == "Suse" and ansible_distribution_major_version|int != 42 and ansible_python.version.major != 3)
|
- not (ansible_os_family == "Suse" and ansible_distribution_major_version|int != 42 and ansible_python.version.major != 3)
|
||||||
|
- not (ansible_distribution == "CentOS" and ansible_distribution_major_version|int == 8) # TODO: cannot start service
|
||||||
- not (ansible_distribution == 'Archlinux') # TODO: package seems to be broken, cannot be downloaded from mirrors?
|
- not (ansible_distribution == 'Archlinux') # TODO: package seems to be broken, cannot be downloaded from mirrors?
|
||||||
- not (ansible_distribution == 'Alpine') # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
- not (ansible_distribution == 'Alpine') # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
||||||
block:
|
block:
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ dependencies:
|
|||||||
- setup_pkg_mgr
|
- setup_pkg_mgr
|
||||||
- setup_openssl
|
- setup_openssl
|
||||||
- setup_remote_tmp_dir
|
- setup_remote_tmp_dir
|
||||||
|
- setup_remote_constraints
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
- name: Install requests<2.20 (CentOS/RHEL 6)
|
- name: Install requests<2.20 (CentOS/RHEL 6)
|
||||||
pip:
|
pip:
|
||||||
name: requests<2.20
|
name: requests<2.20
|
||||||
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
||||||
- name: Install python-consul
|
- name: Install python-consul
|
||||||
pip:
|
pip:
|
||||||
name: python-consul
|
name: python-consul
|
||||||
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
- name: Generate privatekey
|
- name: Generate privatekey
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user