This website requires JavaScript.
Explore
Cloud
Chat
CI/CD
Help
Sign in
cmueller
/
ansible
Watch
1
Star
0
Fork
You've already forked ansible
0
Code
Issues
Pull requests
Projects
Releases
Wiki
Activity
68a8cc2b1f
ansible
/
test
/
integration
/
targets
/
win_hosts
/
aliases
2 lines
25 B
Text
Raw
Normal View
History
Unescape
Escape
Add new windows module: win_hosts (#46450) * Add win_hosts module added win_hosts module for easier manipulation of hosts entries in "%windir%\system32\drivers\etc\hosts" for windows systems * Update win_hosts.py * Add alias support to win_hosts module (#1) * win_hosts supports aliases added support for adding / removing aliases from a host entry, rather than adding a new entry added ability for win_hosts to detect aliases: `192.168.1.1 alias1 alias2 alias3` ``` win_hosts: host_name: alias2 ip_address: 192.168.1.1 ``` will result in `192.168.1.1 alias1 alias3` also includes `replace` and `add` as options for `ip_action` (`replace` is default) for example: ``` 192.168.1.1 my_reused_alias 192.168.1.2 my_reused_alias ``` with ``` win_hosts: host_name: my_reused_alias ip_address: 192.168.1.3 ip_action: add ``` the result will be ``` 192.168.1.1 my_reused_alias 192.168.1.2 my_reused_alias ``` but with `ip_action=replace` the result would be ``` 192.168.1.3 my_reused_alias ``` * fixed metadata version and version added * fix line endings * upload fixed line endings try to upload the file with the fixed line endings * aliases and canonical names are separate entities. added IPv4 and IPv6 validation * only makes changes if "check_mode" is false * improved behavior for duplicate aliases/entries. * adding tests * missing aliases file * fix trailing whitespace and uses explicit paths * Tweak tests to copy and restore original hosts file
2019-03-31 22:54:05 +02:00
shippable/windows/group3
Reference in a new issue
Copy permalink