Skip to content

Commit

Permalink
Use FQCN for docs and remove Ansible version references (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored May 29, 2020
1 parent ae55740 commit 947da18
Show file tree
Hide file tree
Showing 36 changed files with 316 additions and 341 deletions.
21 changes: 10 additions & 11 deletions plugins/modules/win_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@
choices: [ InheritOnly, None, NoPropagateInherit ]
default: "None"
notes:
- If adding ACL's for AppPool identities (available since 2.3), the Windows
Feature "Web-Scripting-Tools" must be enabled.
- If adding ACL's for AppPool identities, the Windows Feature "Web-Scripting-Tools" must be enabled.
seealso:
- module: win_acl_inheritance
- module: win_file
- module: win_owner
- module: win_stat
- module: ansible.windows.win_acl_inheritance
- module: ansible.windows.win_file
- module: ansible.windows.win_owner
- module: ansible.windows.win_stat
author:
- Phil Schwartz (@schwartzmx)
- Trond Hindenes (@trondhindenes)
Expand All @@ -85,14 +84,14 @@

EXAMPLES = r'''
- name: Restrict write and execute access to User Fed-Phil
win_acl:
ansible.windows.win_acl:
user: Fed-Phil
path: C:\Important\Executable.exe
type: deny
rights: ExecuteFile,Write
- name: Add IIS_IUSRS allow rights
win_acl:
ansible.windows.win_acl:
path: C:\inetpub\wwwroot\MySite
user: IIS_IUSRS
rights: FullControl
Expand All @@ -102,7 +101,7 @@
propagation: 'None'
- name: Set registry key right
win_acl:
ansible.windows.win_acl:
path: HKCU:\Bovine\Key
user: BUILTIN\Users
rights: EnumerateSubKeys
Expand All @@ -112,7 +111,7 @@
propagation: 'None'
- name: Remove FullControl AccessRule for IIS_IUSRS
win_acl:
ansible.windows.win_acl:
path: C:\inetpub\wwwroot\MySite
user: IIS_IUSRS
rights: FullControl
Expand All @@ -122,7 +121,7 @@
propagation: 'None'
- name: Deny Intern
win_acl:
ansible.windows.win_acl:
path: C:\Administrator\Documents
user: Intern
rights: Read,Write,Modify,FullControl,Delete
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/win_acl_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@
type: bool
default: no
seealso:
- module: win_acl
- module: win_file
- module: win_stat
- module: ansible.windows.win_acl
- module: ansible.windows.win_file
- module: ansible.windows.win_stat
author:
- Hans-Joachim Kliemeck (@h0nIg)
'''

EXAMPLES = r'''
- name: Disable inherited ACE's
win_acl_inheritance:
ansible.windows.win_acl_inheritance:
path: C:\apache
state: absent
- name: Disable and copy inherited ACE's
win_acl_inheritance:
ansible.windows.win_acl_inheritance:
path: C:\apache
state: absent
reorganize: yes
- name: Enable and remove dedicated ACE's
win_acl_inheritance:
ansible.windows.win_acl_inheritance:
path: C:\apache
state: present
reorganize: yes
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/win_certificate_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,20 @@

EXAMPLES = r'''
- name: Import a certificate
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pem
state: present
- name: Import pfx certificate that is password protected
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pfx
state: present
password: VeryStrongPasswordHere!
become: yes
become_method: runas
- name: Import pfx certificate without password and set private key as un-exportable
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pfx
state: present
key_exportable: no
Expand All @@ -156,30 +156,30 @@
ansible_winrm_transport: credssp
- name: Remove a certificate based on file thumbprint
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pem
state: absent
- name: Remove a certificate based on thumbprint
win_certificate_store:
ansible.windows.win_certificate_store:
thumbprint: BD7AF104CF1872BDB518D95C9534EA941665FD27
state: absent
- name: Remove certificate based on thumbprint is CurrentUser/TrustedPublishers store
win_certificate_store:
ansible.windows.win_certificate_store:
thumbprint: BD7AF104CF1872BDB518D95C9534EA941665FD27
state: absent
store_location: CurrentUser
store_name: TrustedPublisher
- name: Export certificate as der encoded file
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.cer
state: exported
file_type: der
- name: Export certificate and key as pfx encoded file
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pfx
state: exported
file_type: pkcs12
Expand All @@ -189,7 +189,7 @@
become_user: SYSTEM
- name: Import certificate be used by IIS
win_certificate_store:
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pfx
file_type: pkcs12
password: StrongPassword!
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/win_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- The C(win_command) module takes the command name followed by a list of space-delimited arguments.
- The given command will be executed on all selected nodes. It will not be
processed through the shell, so variables like C($env:HOME) and operations
like C("<"), C(">"), C("|"), and C(";") will not work (use the M(win_shell)
like C("<"), C(">"), C("|"), and C(";") will not work (use the M(ansible.windows.win_shell)
module if you need these features).
- For non-Windows targets, use the M(command) module instead.
options:
Expand Down Expand Up @@ -52,34 +52,34 @@
type: str
notes:
- If you want to run a command through a shell (say you are using C(<),
C(>), C(|), etc), you actually want the M(win_shell) module instead. The
C(win_command) module is much more secure as it's not affected by the user's
C(>), C(|), etc), you actually want the M(ansible.windows.win_shell) module instead. The
M(ansible.windows.win_command) module is much more secure as it's not affected by the user's
environment.
- C(creates), C(removes), and C(chdir) can be specified after the command. For instance, if you only want to run a command if a certain file does not
exist, use this.
seealso:
- module: command
- module: psexec
- module: community.windows.psexec
- module: raw
- module: win_psexec
- module: win_shell
- module: community.windows.win_psexec
- module: ansible.windows.win_shell
author:
- Matt Davis (@nitzmahone)
'''

EXAMPLES = r'''
- name: Save the result of 'whoami' in 'whoami_out'
win_command: whoami
ansible.windows.win_command: whoami
register: whoami_out
- name: Run command that only runs if folder exists and runs from a specific folder
win_command: wbadmin -backupTarget:C:\backup\
ansible.windows.win_command: wbadmin -backupTarget:C:\backup\
args:
chdir: C:\somedir\
creates: C:\backup\
- name: Run an executable and send data to the stdin for the executable
win_command: powershell.exe -
ansible.windows.win_command: powershell.exe -
args:
stdin: Write-Host test
'''
Expand Down
24 changes: 12 additions & 12 deletions plugins/modules/win_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,63 +93,63 @@
with remote paths.
- Because win_copy runs over WinRM, it is not a very efficient transfer
mechanism. If sending large files consider hosting them on a web service and
using M(win_get_url) instead.
using M(ansible.windows.win_get_url) instead.
seealso:
- module: community.general.assemble
- module: copy
- module: win_get_url
- module: win_robocopy
- module: ansible.windows.win_get_url
- module: community.windows.win_robocopy
author:
- Jon Hawkesworth (@jhawkesworth)
- Jordan Borean (@jborean93)
'''

EXAMPLES = r'''
- name: Copy a single file
win_copy:
ansible.windows.win_copy:
src: /srv/myfiles/foo.conf
dest: C:\Temp\renamed-foo.conf
- name: Copy a single file, but keep a backup
win_copy:
ansible.windows.win_copy:
src: /srv/myfiles/foo.conf
dest: C:\Temp\renamed-foo.conf
backup: yes
- name: Copy a single file keeping the filename
win_copy:
ansible.windows.win_copy:
src: /src/myfiles/foo.conf
dest: C:\Temp\
- name: Copy folder to C:\Temp (results in C:\Temp\temp_files)
win_copy:
ansible.windows.win_copy:
src: files/temp_files
dest: C:\Temp
- name: Copy folder contents recursively
win_copy:
ansible.windows.win_copy:
src: files/temp_files/
dest: C:\Temp
- name: Copy a single file where the source is on the remote host
win_copy:
ansible.windows.win_copy:
src: C:\Temp\foo.txt
dest: C:\ansible\foo.txt
remote_src: yes
- name: Copy a folder recursively where the source is on the remote host
win_copy:
ansible.windows.win_copy:
src: C:\Temp
dest: C:\ansible
remote_src: yes
- name: Set the contents of a file
win_copy:
ansible.windows.win_copy:
content: abc123
dest: C:\Temp\foo.txt
- name: Copy a single file as another user
win_copy:
ansible.windows.win_copy:
src: NuGet.config
dest: '%AppData%\NuGet\NuGet.config'
vars:
Expand Down
15 changes: 5 additions & 10 deletions plugins/modules/win_dns_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module: win_dns_client
short_description: Configures DNS lookup on Windows hosts
description:
- The C(win_dns_client) module configures the DNS client on Windows network adapters.
- The M(ansible.windows.win_dns_client) module configures the DNS client on Windows network adapters.
options:
adapter_names:
description:
Expand All @@ -27,42 +27,37 @@
- An empty list will configure the adapter to use the DHCP-assigned values on connections where DHCP is enabled,
or disable DNS lookup on statically-configured connections.
- IPv6 DNS servers can only be set on Windows Server 2012 or newer, older hosts can only set IPv4 addresses.
- Before 2.10 use ipv4_addresses instead.
type: list
required: yes
aliases: [ "ipv4_addresses", "ip_addresses", "addresses" ]
notes:
- Before 2.10, when setting an empty list of DNS server addresses on an adapter with DHCP enabled, a change was always registered.
- In 2.10, DNS servers will always be reset if the format of nameservers in the registry is not comma delimited.
See U(https://www.welivesecurity.com/2016/06/02/crouching-tiger-hidden-dns/)
author:
- Matt Davis (@nitzmahone)
- Brian Scholer (@briantist)
'''

EXAMPLES = r'''
- name: Set a single address on the adapter named Ethernet
win_dns_client:
ansible.windows.win_dns_client:
adapter_names: Ethernet
dns_servers: 192.168.34.5
- name: Set multiple lookup addresses on all visible adapters (usually physical adapters that are in the Up state), with debug logging to a file
win_dns_client:
ansible.windows.win_dns_client:
adapter_names: '*'
dns_servers:
- 192.168.34.5
- 192.168.34.6
log_path: C:\dns_log.txt
- name: Set IPv6 DNS servers on the adapter named Ethernet
win_dns_client:
ansible.windows.win_dns_client:
adapter_names: Ethernet
dns_servers:
- '2001:db8::2'
- '2001:db8::3'
- name: Configure all adapters whose names begin with Ethernet to use DHCP-assigned DNS values
win_dns_client:
ansible.windows.win_dns_client:
adapter_names: 'Ethernet*'
dns_servers: []
'''
Expand Down
16 changes: 8 additions & 8 deletions plugins/modules/win_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
description:
- Ensure that the domain named by C(dns_domain_name) exists and is reachable.
- If the domain is not reachable, the domain is created in a new forest on the target Windows Server 2012R2+ host.
- This module may require subsequent use of the M(win_reboot) action if changes are made.
- This module may require subsequent use of the M(ansible.windows.win_reboot) action if changes are made.
options:
dns_domain_name:
description:
Expand Down Expand Up @@ -75,11 +75,11 @@
type: bool
default: yes
seealso:
- module: win_domain_controller
- module: win_domain_computer
- module: win_domain_group
- module: win_domain_membership
- module: win_domain_user
- module: ansible.windows.win_domain_controller
- module: community.windows.win_domain_computer
- module: community.windows.win_domain_group
- module: ansible.windows.win_domain_membership
- module: community.windows.win_domain_user
author:
- Matt Davis (@nitzmahone)
'''
Expand All @@ -94,12 +94,12 @@

EXAMPLES = r'''
- name: Create new domain in a new forest on the target host
win_domain:
ansible.windows.win_domain:
dns_domain_name: ansible.vagrant
safe_mode_password: password123!
- name: Create new Windows domain in a new forest with specific parameters
win_domain:
ansible.windows.win_domain:
create_dns_delegation: no
database_path: C:\Windows\NTDS
dns_domain_name: ansible.vagrant
Expand Down
Loading

0 comments on commit 947da18

Please sign in to comment.