diff options
-rw-r--r-- | docs/docsite/rst/dev_guide/developing_modules_general.rst | 4 | ||||
-rw-r--r-- | lib/ansible/modules/apt_repository.py | 1 | ||||
-rw-r--r-- | lib/ansible/modules/expect.py | 4 | ||||
-rw-r--r-- | lib/ansible/modules/replace.py | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/docs/docsite/rst/dev_guide/developing_modules_general.rst b/docs/docsite/rst/dev_guide/developing_modules_general.rst index 3f1f27fd06..abffcf191c 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general.rst @@ -80,13 +80,13 @@ The simplest way is to use ``ansible`` adhoc command: .. code:: shell - ansible -m library/my_test.py -a 'name=hello new=true' remotehost + ANSIBLE_LIBRARY=./library ansible -m my_test -a 'name=hello new=true' remotehost If your module does not need to target a remote host, you can quickly and easily exercise your code locally like this: .. code:: shell - ansible -m library/my_test.py -a 'name=hello new=true' localhost + ANSIBLE_LIBRARY=./library ansible -m my_test -a 'name=hello new=true' localhost - If for any reason (pdb, using print(), faster iteration, etc) you want to avoid going through Ansible, another way is to create an arguments file, a basic JSON config file that passes parameters to your module so that you can run it. diff --git a/lib/ansible/modules/apt_repository.py b/lib/ansible/modules/apt_repository.py index ec5a52739f..1a1116470e 100644 --- a/lib/ansible/modules/apt_repository.py +++ b/lib/ansible/modules/apt_repository.py @@ -99,6 +99,7 @@ version_added: "0.7" requirements: - python-apt (python 2) - python3-apt (python 3) + - apt-key or gpg ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/expect.py b/lib/ansible/modules/expect.py index 89459225a2..99ffe9f263 100644 --- a/lib/ansible/modules/expect.py +++ b/lib/ansible/modules/expect.py @@ -90,7 +90,7 @@ author: "Matt Martz (@sivel)" EXAMPLES = r''' - name: Case insensitive password string match ansible.builtin.expect: - ansible.builtin.command: passwd username + command: passwd username responses: (?i)password: "MySekretPa$$word" # you don't want to show passwords in your logs @@ -98,7 +98,7 @@ EXAMPLES = r''' - name: Generic question with multiple different responses ansible.builtin.expect: - ansible.builtin.command: /path/to/custom/command + command: /path/to/custom/command responses: Question: - response1 diff --git a/lib/ansible/modules/replace.py b/lib/ansible/modules/replace.py index 6dfd677927..4b8f74f562 100644 --- a/lib/ansible/modules/replace.py +++ b/lib/ansible/modules/replace.py @@ -110,7 +110,7 @@ notes: ''' EXAMPLES = r''' -- name: Before Ansible 2.3, option 'dest', 'destfile' or 'name' was used instead of 'path' +- name: Replace old hostname with new hostname (requires Ansible >= 2.4) ansible.builtin.replace: path: /etc/hosts regexp: '(\s+)old\.host\.name(\s+.*)?$' |