Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new replication subnet group module #56075

Closed
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
bd47e64
Hetzner failover IP: refactoring (#56203)
felixfontein May 10, 2019
8c56c11
nxos_snmp_user: platform fixes for get_snmp_user (#55832)
chrisvanheuveln May 10, 2019
776ec08
Ensure 'authorize' is always bool, regardless of source (#56271)
Qalthos May 10, 2019
1097632
eos_l2_interface: Handle `Interface does not exist` (#56140)
Qalthos May 10, 2019
1554bef
nxos_vpc:Fix multiple idempotency issues, add missing commands (#55735)
chrisvanheuveln May 10, 2019
3fdc4ba
To fix IOS static route CI failure (#56292)
justjais May 10, 2019
3c8d8b1
should have gone into 52373 (#56306)
acozine May 10, 2019
ecdb616
NetApp ONTAP module for manage ipspaces (#49821)
May 10, 2019
f5326aa
Update os_image documentation (#49705)
akshay1610 May 10, 2019
9f86257
VMware: support folder param in vmware_vm_facts (#56298)
Akasurde May 11, 2019
7e6be4e
VMware: vmware_guest_disk support for use_instance_uuid (#56107)
Akasurde May 11, 2019
031655d
Adding Support for Traffic Class in Onyx Switches (#55577)
anasbadaha May 11, 2019
0cb0fa9
Adding Support for NVE Protocol in onyx_protocol (#55513)
anasbadaha May 11, 2019
0f852f0
Adding Support For EVPN in BGP Module (#55503)
anasbadaha May 11, 2019
05cee75
Hetzner failover IP info module (#56186)
felixfontein May 11, 2019
099917d
inventory: virtualbox: fix typo in examples (#56328)
RenderQwerty May 11, 2019
1a6b95a
redfish: Add If-Match ETag header to PATCH requests (#56150)
billdodd May 12, 2019
c6a8e99
Added the mtu property to the os_network module (#55881) (#54730)
maiqueb May 12, 2019
6b6f500
adding missing variable
ruimoreira May 12, 2019
35c655c
modify azure_rm_aks* document (#56293)
Fred-sun May 13, 2019
27fcd0f
Fix typo in aws log group return documentation (#56335)
ashleyconnor May 13, 2019
d0f2da4
nxos: remove deprecated test target files (#55949)
chrisvanheuveln May 13, 2019
d998791
Bug fixes for the nios member object (#56045)
krisvasudevan May 13, 2019
661f7be
To fix the issue where nios_zone module was running second time for s…
justjais May 13, 2019
f49a677
update azure_rm_applicationsecuritygroup document (#56344)
Fred-sun May 13, 2019
c1ebc8d
Update default roles_path documentation (#56320)
samdoran May 13, 2019
110b8ba
ansible-config doesn't edit configs (#56355)
sbonds May 13, 2019
ef0851d
IBM_Storage: fixed a bug - Unwanted arguments cause failure (#56357)
tzurE May 13, 2019
85fa65e
docs: Update scopes value example (#56362)
isaac88 May 13, 2019
6948e04
Add myself to committer list. (#56363)
felixfontein May 13, 2019
eefc90b
Revert oracle (#56364)
mattclay May 13, 2019
4b99a2a
vmware: use hostname in esxi_hostname
goneri May 13, 2019
21d4e23
vmware_vm_facts: fix the test with vcsim
goneri May 13, 2019
cf78759
vmware_vm_facts: fix the support with regular ESXi
goneri May 3, 2019
f88dedb
Fixed snapshot module, Resource not found issue for persistent-disk-0…
Rahul-CSI May 13, 2019
5b4cd22
Revert "inventory: virtualbox: fix typo in examples (#56328)" (#56374)
resmo May 14, 2019
7a32bd8
VMware: Improve vmware_portgroup (#56382)
Akasurde May 14, 2019
49ecfdb
update azure_rm_autoscale document (#56388)
Fred-sun May 14, 2019
0ee673a
Issue55222 (#55223)
ajsiersema May 14, 2019
88be323
Fix 2.8 changlog url and reverse order porting guides TOC (#56373)
samccann May 14, 2019
30ccc8e
Fix VyOS cli prompt issues (#56389)
NilashishC May 14, 2019
8968d41
[doc] command module: mention all parameter types (#56396)
pilou- May 14, 2019
674a57c
fix module defaults (#56020)
bcoca May 14, 2019
b3ab83b
[doc] fix example: always trigger the handler (#56384)
pilou- May 14, 2019
7f41cc4
[doc] expect module: mention all parameter types (#56394)
pilou- May 14, 2019
84f5666
update azure_rm_appgateway document (#56339)
Fred-sun May 14, 2019
22d7e7e
update azure_rm_appserviceplan related module documents (#56348)
Fred-sun May 14, 2019
f9b56a5
Add sanity test to check for unwanted files.
mattclay May 13, 2019
2d4cbe0
Modify/fix handling of noreplace option issue #55365 (#55967)
wltjr May 14, 2019
4a2fa46
Remove old references to `cloud-config-aws.yml`.
mattclay May 14, 2019
0d2a120
Merge pull request #56383 from Tomorrow9/fix_pr56296
Tomorrow9 May 14, 2019
75788ec
azure_rm_virtualmachine (and _facts): add boot_diagnostics control an…
jeking3 May 14, 2019
ec2db1a
Initial commit - Oracle modules
nalsaber May 14, 2019
e98e987
Initial commit for Oracle Cloud Infrastructure modules
nalsaber May 14, 2019
826b99d
dnf: fix wildcard matching for state: absent (#56013)
mkrizek May 14, 2019
fd65f03
winrm - fix failure parsing for send input errors (#56245)
jborean93 May 14, 2019
8e2bff4
Change S3 bucket urls to new method as per #56124 (#56418)
ShachafGoldstein May 15, 2019
3170e8b
azure_rm_securitygroup - fix delete error handling (#56422)
jeking3 May 15, 2019
107d9ef
VMware: Check to retrieve list of all used disks (#56380)
pratikgadiya12 May 15, 2019
5ef2c53
Fixed error handling in github_issue module (#39652)
Akasurde May 15, 2019
666dfdc
YUM - handle enable of non-existent repo (#53286)
maxamillion May 15, 2019
3b08e75
hetzner changed image tag for server, so its working with ids and nam…
ciliusmp May 15, 2019
8ce09a0
VMware: fix inventory plugin (#56431)
Akasurde May 15, 2019
4928373
Allow config commands in aireos_command to support prompts (#56130)
netsiphon May 15, 2019
6315598
[eos] Allow ports to be configured with just trunk mode (#55887)
sc68cal May 15, 2019
fa7aedc
Remove hardcoded ansible user for junos_user integration tests (#56452)
pabelanger May 15, 2019
322cfa4
Meraki - Add check for auth_key parameter (#56199)
kbreit May 15, 2019
940d58e
Nullify improperly licensed test file
jctanner May 14, 2019
6182f36
Small typo fix in documentation (#56480)
m3adow May 15, 2019
db42cf5
Update ovirt_vnic_profile.py (#56466)
chashtag May 15, 2019
d55823b
Update of Ansible 2.8 roadmap (add RC2 & RC3) (#56436)
thomasboussekey May 15, 2019
f097dca
update release table for 2.8 (#56486)
samccann May 15, 2019
4bf1347
changed version to 2.8 (#56487)
samccann May 15, 2019
183ba93
removed previouslly deprecated settings (#55662)
bcoca May 15, 2019
6359310
[Doc-Release-2.8] fixed broken module links in 2.8 porting guide (#56…
samccann May 16, 2019
7636f36
gcp_compute_target_proxy does not exist, update deprecated redirect (…
acozine May 16, 2019
ca7ff2a
VMware: return info about SCSI controller in vmware_guest_disk_facts …
spidermila May 16, 2019
216260c
VMware: vsphere_copy: ability to target an esxi instance (#55930)
goneri May 16, 2019
0e0735f
VMware: Return facts about rule_affinity vmware_drs_rule_facts (#55813)
AravindBalajiS May 16, 2019
50e9955
VMware: Add new module vmware_folder_info (#54344)
davidmhewitt May 16, 2019
75046f8
postgresql_db: added tablespace support (#56390)
Andersson007 May 16, 2019
118cf3e
Cloud dev docs to rst (#56485)
acozine May 16, 2019
4b39748
Update azure_rm_cdnprofile related module document (#56503)
Fred-sun May 16, 2019
a4f0861
VMware: vmware_datastore_maintenancemode: check params (#56515)
goneri May 16, 2019
f88b660
adds 2.9 roadmap, reversed local TOC order (#56371)
acozine May 16, 2019
409c46b
Properly handle check for session support on eos (#56407)
Qalthos May 16, 2019
d5a272c
Fix eos_support_session logic (#56524)
Qalthos May 16, 2019
4b00141
Bump erlang ping to 1:20.3.8.18-1
sivel May 16, 2019
d59eb9e
meraki_switchport - Improve reliability (#54275)
kbreit May 16, 2019
a910d19
Temporary fix for vsphere_copy CI failure.
mattclay May 16, 2019
730456b
Add seed parameter to random_mac filter (#51841)
s-hamann May 16, 2019
7e997fd
Update ovirt_vnic_profile.py (#56518)
chashtag May 16, 2019
98246f6
consul modules: update documentation (#56408)
pilou- May 16, 2019
867e357
When not using file_per_task, make sure we don't prematurely close th…
sivel May 16, 2019
32620b7
vsphere_copy: fix the E309 error (#56537)
goneri May 16, 2019
c8e179f
Aws waf region (#48953)
mjmayer May 17, 2019
a3c3fd9
move too old version to 2.3 (#56540)
samccann May 17, 2019
2a187f3
meraki - Unchanged requests now return the original data (#53576)
kbreit May 17, 2019
6c1dbbe
Fix the test syntax (#56557)
yuwzho May 17, 2019
06c050e
asa_config fix (#56559)
rohitthakur2590 May 17, 2019
ba8846a
update azure_rm_containerregisty document (#56560)
Fred-sun May 17, 2019
1eb5fb9
Add os_profile to VM facts, allow to filter by OS (#48040)
pmarques May 17, 2019
dfab364
Update azure_rm_containerinstance related module document (#56556)
Fred-sun May 17, 2019
11c63d6
Update azure_rm_cdnendpoint related module document (#56440)
Fred-sun May 17, 2019
c6b40f4
register: fail when invalid var name is specified (#56456)
mkrizek May 17, 2019
2897cf4
Fix typo in mount doc (#56566)
Cuttlerat May 17, 2019
27aca73
meraki_ssid - Add examples to documentation (#56425)
kbreit May 17, 2019
6c1a255
Fix hcloud tests
LKaemmerling May 14, 2019
18f22de
Fix typo that breaks invocation of os_stack (#56575)
brtkwr May 17, 2019
63e33f7
Fix eos_l2_interface idempotency (#56531)
Qalthos May 17, 2019
b593548
Updated utils to remove Avi SDK dependency and Avi 18.2.2 version upd…
chaitanyaavi May 17, 2019
576593e
Whitelist listen as a valid keyword on TaskInclude (#56586)
sivel May 17, 2019
5a7bce1
Adding New Model onyx_qos for Configuring QoS on Onyx Switches (#55127)
anasbadaha May 17, 2019
470371d
Remove unused cloud config files.
mattclay May 17, 2019
b8c170a
vmware_datastore_facts: handle external datastore
goneri Apr 4, 2019
3f4a22d
Add compat tojson filter for jinja2 versions missing it (#56596)
sivel May 18, 2019
4742897
Move backport guide to 2.8 (#56578)
kbreit May 18, 2019
f1b5836
lib/ansible/parsing/ajson.py: added UNIT-tests (#56398)
Andersson007 May 18, 2019
386cef1
module_utils.postgres: added unittests (#56381)
Andersson007 May 18, 2019
52a89b2
Fix typo in pg server ping (#56608)
monkz May 18, 2019
708bda0
docker connection plugin: make privilege escalation code more similar…
felixfontein May 19, 2019
94c8685
- shorter parameter names
ruimoreira May 19, 2019
b2622f6
Add service endpoints when creation (#56561)
yuwzho May 20, 2019
7a615a9
Pluribus Network vrouter ospf module with unit tests (#56435)
rajaspachipulusu17 May 20, 2019
8c29c78
Pluribus Networks vrouter loopback interface module with UT (#56450)
rajaspachipulusu17 May 20, 2019
bd061fd
BUGFIX updating existing managed filters fails (#56631)
evertmulder May 20, 2019
34e9d67
Templar: encapsulate _available_variables (#55435)
mkrizek May 20, 2019
ea4842c
Changing the license to Apache 2
evgenyfedoruk May 19, 2019
b37ae35
azure_rm_azurefirewall (#56359)
May 20, 2019
e598eee
Bug fixes for GCP modules (#55977)
modular-magician May 20, 2019
d4b29e7
Bug fixes for GCP modules (#55975)
modular-magician May 20, 2019
8d82df5
Bug fixes for GCP modules (#55974)
modular-magician May 20, 2019
b712b01
Bug fixes for GCP modules (#55973)
modular-magician May 20, 2019
abca3f1
Clarify documentation on _info vs. _facts modules (#56611)
felixfontein May 20, 2019
2a90cbd
Update gcp_compute_instance_facts.py (#56581)
fernandezcuesta May 20, 2019
6b24043
Update vagrant.py (#56568)
Ninroot May 20, 2019
ded7949
vultr: streamline docs (#56563)
resmo May 20, 2019
d56c975
update azure_rm_availabilityset related module document (#56432)
Fred-sun May 20, 2019
77f3e84
Update uri.py (#56395)
JonTheNiceGuy May 20, 2019
6496084
Update unarchive.py (#56285)
mirumu May 20, 2019
66bfa27
Replace deprecated ansible-container references (#56427)
sethhochberg May 20, 2019
493cf81
Don't rely on netloc for determining hostname and port, just use host…
sivel May 20, 2019
d8a5efa
iam_role.py remove_policies should remove all of the requested polici…
mhoroschun May 21, 2019
8e1dd58
Allow python_requirements_facts to cope with packages with dashes (#5…
willthames May 21, 2019
3b4b2e5
[docker] support the lookup of images by digest (#56649)
das7pad May 21, 2019
a4144e1
kubevirt_vm: Improve create VM from template (#55927)
machacekondra May 21, 2019
e135661
Move update_cache to after self.yum_baseurl definition (#56613)
Zeophlite May 21, 2019
4dee569
changed type for strings
May 21, 2019
afc678e
Raise error in case of empty hosts list in playbook (#56354)
cinek810 May 21, 2019
7f5b1e9
Out put the version of the dependency so we can better understand the…
jonpugh May 21, 2019
77f9974
yum: use Custom Group in integration tests (#56439)
mkrizek May 21, 2019
a68ac72
yum: fix false error msg about autoremove support (#56459)
mkrizek May 21, 2019
388f5d0
Add links to quickstart guides (#56722)
samccann May 21, 2019
a608ca0
na_ontap_volume - added qos policy module options (#56026)
May 21, 2019
e64083e
remove quote (#56690)
Fred-sun May 21, 2019
ac22cd3
fixed doc build errors (#56735)
samccann May 21, 2019
8495e3d
update more azure documentation (#56700)
Fred-sun May 21, 2019
41cc198
Update azure_rm_devtestlab related module document (#56681)
Fred-sun May 21, 2019
d7dc958
Update azure_rm_deployment related document (#56627)
Fred-sun May 21, 2019
b275ded
Adds one more example for `rollbar_deployment` module (#56535)
May 21, 2019
53ec9c8
Clarify that GPLv3+ module_utils need core team approval (#56740)
felixfontein May 21, 2019
cb9be4d
Update get_certificate.py (#56594)
jimwitte May 21, 2019
6900378
[WIP] Tip to see the content of a single encrypted var (#37887)
csillab May 21, 2019
d8c1f67
win_file_version: fix typos (#56751)
ksubileau May 22, 2019
3e8ca02
lookup: consul_kv: Add datacenter parameter (#56647)
jscaltreto May 22, 2019
4065692
k8s minor bug fixes (#56168)
willthames May 22, 2019
459776e
VMware: Add folder option for vmware_dvswitch (#56707)
Akasurde May 22, 2019
f824a13
remove azure_rm_cdnprofile quote (#56695)
Fred-sun May 22, 2019
f9108e2
postgresql_db: bugfix 56703 (#56734)
Andersson007 May 22, 2019
e4239d9
Fix workload profileId indexing in netapp_e_volume module (#56747)
swartzn May 22, 2019
4f89c1d
Revert "ACI: Implement encoded query_string" (#56783)
dagwieers May 22, 2019
69b2d7e
fix collection adjacent loading with --playbook-dir (#56194)
bcoca May 22, 2019
8fe9618
preserve underlying block building error (#56465)
bcoca May 22, 2019
cea7151
The InventoryData class does not have a get_vars method and Inventory…
s-hertel May 22, 2019
831d3c7
add azure_rm_keyvault_info (#55497)
yungezz May 22, 2019
96d2dd3
Adding example for add host to groups (#56756)
Deathice May 22, 2019
71ec184
modify document (#56762)
Fred-sun May 22, 2019
16fb3ff
modify azure_rm_devtestlabcustomimage's document (#56763)
Fred-sun May 22, 2019
22d2c62
Update azure_rm_cosmosdbaccount related module document (#56624)
Fred-sun May 22, 2019
4680ed4
modify azure_rm_devtestlabenvironment relate document (#56769)
Fred-sun May 22, 2019
584a32e
modify azure_rm_devtestlabpolicy relate document (#56770)
Fred-sun May 22, 2019
8bb3274
Improvement on setting VALID_INCLUDE_KEYWORDS on HandlerTaskInclude (…
sivel May 22, 2019
57e4284
Add a new "log_folder" option to the log_plays callback plugin. (#56717)
paddynewman May 22, 2019
eb9009c
added missing version_added
bcoca May 22, 2019
391a104
openssl_pkcs12: fix crash due to wrong path used for loading key in c…
felixfontein May 22, 2019
bb50fc3
construct_deep_url() (#53475)
RobW3LGA May 22, 2019
54aa6f3
ACI CDP Interface Policy Module Creation (#54818)
tknipper11 May 22, 2019
2a9b9d6
Show access keys for azure_rm_storageaccount (#56612)
mmyyrroonn May 23, 2019
124400f
win_get_url: ignore defender false positive in tests (#56812)
jborean93 May 23, 2019
64b30b1
docs: cron: fix for example raises a warning. (#56701)
JulienPalard May 23, 2019
0d842ff
redfish: refactor service_root variable (#56198)
billdodd May 23, 2019
5005c35
VMware: vcenter_folder: print full path of the new folder (#55237)
goneri May 23, 2019
cebb363
eos_l2_interface handle "Interface does not exist" (#56787)
Qalthos May 23, 2019
26d38dd
VMware: Add folder param in vmware_datastore_cluster
Akasurde May 21, 2019
3095df0
vmware_vmkernel: no error on state=absent
goneri Apr 11, 2019
1da47bf
Prevent vars premature templating (#56117)
bcoca May 23, 2019
7f0bf0a
Config toggle for duplicate dict key warnings (fixes #56799) (#56805)
agaffney May 23, 2019
22b9525
Preserve ssh error (#56460)
bcoca May 23, 2019
8f4f375
Ensure uri module always returns status even on failure (#56240)
samdoran May 23, 2019
7b9d7e6
yum: handle "_none_" value for proxy (#56725)
mkrizek May 23, 2019
3129fc0
Update RHEL repo for Ansible 2.8 (#56859)
samccann May 23, 2019
f9b43a0
Copyright fix for 2018 (#56860)
samccann May 23, 2019
fa6d328
kubevirt: Fix RS and presets template parameters (#56865)
machacekondra May 23, 2019
8168c96
kubevirt_vm: Fix checking of VM update (#56846)
machacekondra May 23, 2019
2068062
Modify azure_rm_devtestlabschedule related document (#56819)
Fred-sun May 23, 2019
ab96d22
📝 Add a GitHub-specific security policy note
webknjaz May 23, 2019
fc94d79
CLI docs include license not copyright (#56871)
acozine May 23, 2019
8cee127
vmware_host_datastore: ability to target a ESXi
goneri May 15, 2019
3b16036
Keep machinectl from parsing options of cmd (#56572)
ttencate May 23, 2019
4adb7cf
Always keep subset data for callbacks (#56881)
bcoca May 23, 2019
6bb21c3
vmware: test-refactoring
goneri May 16, 2019
9c5b721
Validate types before asserting lengths (#56882)
sivel May 23, 2019
50b1a66
Update instructions for running module directly (#56883)
samdoran May 23, 2019
7834da4
Move eos l3 test IP addresses to documentation ranges (#56726)
Qalthos May 24, 2019
6ebfe41
Spelling typo (#56878)
dmp1ce May 24, 2019
d88d71e
route53_zone: return existing zone id in check mode (#56702)
zyv May 24, 2019
f65df91
kubevirt_vm: simplify previous change + update comments (#56897)
mmazur May 24, 2019
dad6250
Update azure_rm_devtestlabvirtualnetwork relate document (#56893)
Fred-sun May 24, 2019
9a563f8
Windows FAQ: fix reference (#56909)
akamch May 24, 2019
f96529d
warn on systemd globs (#56645)
bcoca May 24, 2019
db6407d
Correct typo in playbooks_intro.rst (#56919)
jonbride May 24, 2019
bc50a52
Handle binding:vnic_type as optional (#55526)
dominikholler May 24, 2019
6c74e29
Add dns_domain into os_network.py (#56453)
StingRayZA May 24, 2019
4f25435
Handle openstacksdk < 0.10.0: fix AttributeError (#50285)
pilou- May 24, 2019
f76556e
Update package.py (#56731)
tayebBenAchour May 24, 2019
30210e7
added tests for log_plays (#56811)
bcoca May 24, 2019
fca2a4c
adds ltm policy to bigip facts (#56926)
wojtek0806 May 24, 2019
6e66ea9
Properly detect is_chroot fact on XFS for non-root (#56899)
mkrizek May 24, 2019
27dcf8a
Not native, but text (#55676)
bcoca May 24, 2019
86354ff
postgresql: remove depricated lib (#56641)
Andersson007 May 24, 2019
3b9478a
Migrate away from pipes.quote (#56785)
mkrizek May 24, 2019
484c023
ansible-test: prefer shlex.quote (#56823)
mkrizek May 24, 2019
a7837ed
some logging fixes (#56311)
bcoca May 24, 2019
2f523ad
docker conncetion plugin: accept 'dev' as 'newest version' (#56947)
felixfontein May 26, 2019
37df89b
[docker_network] Fix idempotency when using aux_addresses in ipam_con…
SirFerdek May 26, 2019
2aaa4f9
implementing check mode
ruimoreira May 26, 2019
832e665
Merge branch 'dms_replication_subnet_group' of github.com:ruimoreira/…
ruimoreira May 26, 2019
f480ae0
new replication subnet group module
ruimoreira May 4, 2019
e64b484
fixed a few linting issues
ruimoreira May 4, 2019
b4d7bd3
fixed a few linting issues
ruimoreira May 4, 2019
0894fc6
reduced spacing and fixed indentation issues
ruimoreira May 4, 2019
bea05e8
updated docs and examples
ruimoreira May 6, 2019
a3a2929
fixed yaml issues with documentation
ruimoreira May 6, 2019
c8a07b9
fixed pep8 issues
ruimoreira May 6, 2019
b4c516c
changed tests to remove static subnet ids, alaso added code to create…
ruimoreira May 6, 2019
024b40e
adding missing variable
ruimoreira May 12, 2019
0dde1a5
- shorter parameter names
ruimoreira May 19, 2019
b25ae02
changed type for strings
May 21, 2019
2c023f1
implementing check mode
ruimoreira May 26, 2019
6e1ea79
Merge branch 'dms_replication_subnet_group' of github.com:ruimoreira/…
ruimoreira May 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
248 changes: 248 additions & 0 deletions lib/ansible/modules/cloud/amazon/dms_replication_subnet_group.py
@@ -0,0 +1,248 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use short notation of the GPL header

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}


DOCUMENTATION = '''
---
module: dms_replication_subnet_group
short_description: creates or destroys a data migration services subnet group
description:
- creates or destroys a data migration services subnet group
version_added: "2.9"
options:
state:
description:
- State of the subnet group
default: present
choices: ['present', 'absent']
resmo marked this conversation as resolved.
Show resolved Hide resolved
subnetgroupidentifier:
description:
- The name for the replication subnet group.
This value is stored as a lowercase string.
Must contain no more than 255 alphanumeric characters,
periods, spaces, underscores, or hyphens. Must not be "default".
subnetgroupdescription:
description:
- The description for the subnet group.
subnetids:
description:
- A list containing the subnet ids for the replication subnet group,
needs to be at least 2 items in the list
author:
- "Rui Moreira (@ruimoreira)"
extends_documentation_fragment:
- aws
- ec2
'''

EXAMPLES = '''
- dms_replication_subnet_group:
state: present
subnetgroupidentifier: "dev-sngroup"
subnetgroupdescription: "Development Subnet Group asdasdas"
subnetids: ['subnet-id1','subnet-id2']
'''

RETURN = ''' # '''
__metaclass__ = type
import traceback
from ansible.module_utils.aws.core import AnsibleAWSModule
from ansible.module_utils.ec2 import boto3_conn, HAS_BOTO3, \
camel_dict_to_snake_dict, get_aws_connection_info, AWSRetry
try:
import botocore
except ImportError:
pass # caught by AnsibleAWSModule

backoff_params = dict(tries=5, delay=1, backoff=1.5)
@AWSRetry.backoff(**backoff_params)
def describe_subnet_group(connection, subnet_group):
"""checks if instance exists"""
try:
subnet_group_filter = dict(Name='replication-subnet-group-id',
Values=[subnet_group])
return connection.describe_replication_subnet_groups(Filters=[subnet_group_filter])
except botocore.exceptions.ClientError:
return {'ReplicationSubnetGroups': []}


@AWSRetry.backoff(**backoff_params)
def replication_subnet_group_create(connection, **params):
""" creates the replication subnet group """
return connection.create_replication_subnet_group(**params)


@AWSRetry.backoff(**backoff_params)
def replication_subnet_group_modify(connection, **modify_params):
return connection.modify_replication_subnet_group(**modify_params)


@AWSRetry.backoff(**backoff_params)
def replication_subnet_group_delete(connection):
subnetid = module.params.get('subnetgroupidentifier')
delete_parameters = dict(ReplicationSubnetGroupIdentifier=subnetid)
return connection.delete_replication_subnet_group(**delete_parameters)


def get_dms_client(aws_connect_params, client_region, ec2_url):
client_params = dict(
module=module,
conn_type='client',
resource='dms',
region=client_region,
endpoint=ec2_url,
**aws_connect_params
)
return boto3_conn(**client_params)


def replication_subnet_exists(subnet):
""" Returns boolean based on the existance of the endpoint
:param endpoint: dict containing the described endpoint
:return: bool
"""
return bool(len(subnet['ReplicationSubnetGroups']))


def create_module_params():
"""
Reads the module parameters and returns a dict
:return: dict
"""
instance_parameters = dict(
# ReplicationSubnetGroupIdentifier gets translated to lower case anyway by the API
ReplicationSubnetGroupIdentifier=module.params.get('subnetgroupidentifier').lower(),
ReplicationSubnetGroupDescription=module.params.get('subnetgroupdescription'),
SubnetIds=module.params.get('subnetids'),
)

return instance_parameters


def compare_params(param_described):
"""
Compares the dict obtained from the describe function and
what we are reading from the values in the template We can
never compare passwords as boto3's method for describing
a DMS endpoint does not return the value for
the password for security reasons ( I assume )
"""
modparams = create_module_params()
changed = False
# need to sanitize values that get retured from the API
if 'VpcId' in param_described.keys():
param_described.pop('VpcId')
if 'SubnetGroupStatus' in param_described.keys():
param_described.pop('SubnetGroupStatus')
for paramname in modparams.keys():
if paramname in param_described.keys() and \
param_described.get(paramname) == modparams[paramname]:
pass
elif paramname == 'SubnetIds':
subnets = []
for subnet in param_described.get('Subnets'):
subnets.append(subnet.get('SubnetIdentifier'))
for modulesubnet in modparams['SubnetIds']:
if modulesubnet in subnets:
pass
else:
changed = True
return changed


def create_replication_subnet_group(connection):
try:
params = create_module_params()
return replication_subnet_group_create(connection, **params)
except botocore.exceptions.ClientError as e:
module.fail_json(msg="Failed to create DMS replication subnet group.",
exception=traceback.format_exc(),
**camel_dict_to_snake_dict(e.response))
except botocore.exceptions.BotoCoreError as e:
module.fail_json(msg="Failed to create DMS replication subnet group.",
exception=traceback.format_exc())


def modify_replication_subnet_group(connection):
try:
modify_params = create_module_params()
return replication_subnet_group_modify(connection, **modify_params)
except botocore.exceptions.ClientError as e:
module.fail_json(msg="Failed to Modify the DMS replication subnet group.",
exception=traceback.format_exc(),
**camel_dict_to_snake_dict(e.response))
except botocore.exceptions.BotoCoreError as e:
module.fail_json(msg="Failed to Modify the DMS replication subnet group.",
exception=traceback.format_exc())


def delete_replication_subnet_group(connection):
return True


def main():
argument_spec = dict(
state=dict(choices=['present', 'absent'], default='present'),
subnetgroupidentifier=dict(required=True),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a blocker but I find these long params very hard to read and because the module is named dms_replication_subnet_group, why not just skip subnetgroup and only use identifier and description ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@resmo this has been addressed

subnetgroupdescription=dict(required=True),
subnetids=dict(type='list', required=True),
)
global module
module = AnsibleAWSModule(
argument_spec=argument_spec,
required_if=[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

supports_check_mode=False
)
exit_message = None
changed = False
if not HAS_BOTO3:
module.fail_json(msg='boto3 required for this module')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a helper "missing dependency" error output. please see exsiting modules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please point me in the right direction here ?


state = module.params.get('state')
aws_config_region, ec2_url, aws_connect_params = \
get_aws_connection_info(module, boto3=True)
dmsclient = get_dms_client(aws_connect_params, aws_config_region, ec2_url)
subnet_group = describe_subnet_group(dmsclient,
module.params.get('subnetgroupidentifier'))
if state == 'present':
if replication_subnet_exists(subnet_group):
if compare_params(subnet_group["ReplicationSubnetGroups"][0]):
changed = True
exit_message = modify_replication_subnet_group(dmsclient)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not implement check mode?

if not module.check_mode:
    exit_message = modify_replication_subnet_group(dmsclient)
else: 
    exit_message = " a phrase that makes sense in check mode"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also addressed

else:
exit_message = "No changes to Subnet group"
else:
exit_message = create_replication_subnet_group(dmsclient)
changed = True
elif state == 'absent':
if replication_subnet_exists(subnet_group):
changed = True
replication_subnet_group_delete(dmsclient)
exit_message = "Replication subnet group Deleted"

else:
changed = False
exit_message = "Replication subnet group does not exist"

module.exit_json(changed=changed, msg=exit_message)


if __name__ == '__main__':
main()
2 changes: 2 additions & 0 deletions test/integration/targets/dms_replication_subnet_group/aliases
@@ -0,0 +1,2 @@
cloud/aws
unsupported
144 changes: 144 additions & 0 deletions test/integration/targets/dms_replication_subnet_group/tasks/main.yml
@@ -0,0 +1,144 @@
---

- name: set connection information for all tasks
set_fact:
aws_connection_info: &aws_connection_info
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
region: "{{ aws_region }}"
resource_prefix: "test_dms_sg"
dms_sg_identifier: "{{ resource_prefix }}-dms"
no_log: no

- block:
- name: Create VPC for use in testing
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
cidr_block: 10.22.32.0/23
tags:
Name: Ansible ec2_instance Testing VPC
tenancy: default
register: testing_vpc

- name: create subnet1
ec2_vpc_subnet:
state: present
vpc_id: "{{ testing_vpc.vpc.id }}"
cidr: 10.22.32.16/28
az: eu-west-1a
register: subnet1

- name: create subnet2
ec2_vpc_subnet:
state: present
vpc_id: "{{ testing_vpc.vpc.id }}"
cidr: 10.22.32.32/28
az: eu-west-1c
register: subnet2

- name: create replication subnet subnet group
dms_replication_subnet_group:
state: present
subnetgroupidentifier: "dev-sngroup"
subnetgroupdescription: "Development Subnet Group asdasdas"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
register: result

- assert:
that:
- result is changed
- result is not failed

- name: create subnet group no change
dms_replication_subnet_group:
state: present
subnetgroupidentifier: "{{ dms_sg_identifier }}"
subnetgroupdescription: "Development Subnet Group"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
<<: *aws_connection_info
register: result

- assert:
that:
- result is not changed
- result is not failed

- name: update subnet group
dms_replication_subnet_group:
state: present
subnetgroupidentifier: "{{ dms_sg_identifier }}"
subnetgroupdescription: "Development Subnet Group updated"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
<<: *aws_connection_info
register: result

- assert:
that:
- result is changed
- result is not failed

- name: update subnet group no change
dms_replication_subnet_group:
state: present
subnetgroupidentifier: "{{ dms_sg_identifier }}"
subnetgroupdescription: "Development Subnet Group updated"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
<<: *aws_connection_info
register: result

- assert:
that:
- result is not changed
- result is not failed

always:
- name: delete subnet group no change
dms_replication_subnet_group:
state: absent
subnetgroupidentifier: "{{ dms_sg_identifier }}"
subnetgroupdescription: "Development Subnet Group updated"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
<<: *aws_connection_info
register: result

- assert:
that:
- result is changed
- result is not failed

- name: delete subnet group no change
dms_replication_subnet_group:
state: absent
subnetgroupidentifier: "{{ dms_sg_identifier }}"
subnetgroupdescription: "Development Subnet Group updated"
subnetids: [ "{{ subnet1.subnet.id }}", "{{ subnet2.subnet.id }}"]
<<: *aws_connection_info
register: result

- assert:
that:
- result is not changed
- result is not failed

- name: delete subnet1
ec2_vpc_subnet:
state: absent
vpc_id: "{{ testing_vpc.vpc.id }}"
cidr: 10.22.32.16/28
az: eu-west-1a

- name: delete subnet2
ec2_vpc_subnet:
state: absent
vpc_id: "{{ testing_vpc.vpc.id }}"
cidr: 10.22.32.32/28
az: eu-west-1c

- name: delete VPC for use in testing
ec2_vpc_net:
name: "{{ resource_prefix }}-vpc"
cidr_block: 10.22.32.0/23
tags:
Name: Ansible ec2_instance Testing VPC
tenancy: default
state: absent