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

add new module: azure_rm_rediscachefirewallrule #53161

Open
wants to merge 7 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@yungezz
Copy link
Contributor

yungezz commented Mar 1, 2019

SUMMARY
  1. add new module azure_rm_rediscachefirewallrule
  2. change term "redis cache" to "Azure Cache for Redis" in existing redis modules.
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

@yungezz yungezz requested a review from zikalino Mar 1, 2019

@yungezz yungezz changed the title Yungez redis firewall add new module: azure_rm_rediscachefirewallrule Mar 1, 2019

@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 1, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/cloud/azure/azure_rm_rediscachefirewallrule.py:225:9: E303 too many blank lines (2)

click here for bot help

@zikalino
Copy link
Contributor

zikalino left a comment

looks good, just a few small comments

@yungezz

This comment has been minimized.

Copy link
Contributor Author

yungezz commented Mar 4, 2019

ready_for_review

@yungezz

This comment has been minimized.

Copy link
Contributor Author

yungezz commented Mar 4, 2019

add manual test result for reference.

TASK [Create firewall rule (Check mode)] ******************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:44
Monday 04 March 2019  10:59:50 +0800 (0:00:02.060)       0:00:03.576 **********
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: yungez
<127.0.0.1> EXEC /bin/sh -c 'echo ~yungez && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593 `" && echo ansible-tmp-1551668390.1411326-142180409811593="` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593 `" ) && sleep 0'
Using module file /home/yungez/.ansible/roles/azure_preview_modules/library/azure_rm_rediscachefirewallrule.py
<127.0.0.1> PUT /home/yungez/.ansible/tmp/ansible-local-8449ywqf906r/tmp03rz3rc1 TO /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593/AnsiballZ_azure_rm_rediscachefirewallrule.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593/ /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/yungez/src/ansible/venv/bin/python /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/yungez/.ansible/tmp/ansible-tmp-1551668390.1411326-142180409811593/ > /dev/null 2>&1 && sleep 0'
 [WARNING]: Azure API profile latest does not define an entry for RedisManagementClient

changed: [localhost] => changed=true
  id: null
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      auth_source: null
      cache_name: testredis1aa
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      end_ip_address: 192.168.1.4
      name: myrule1
      password: null
      profile: null
      resource_group: yungezrerdistest1
      secret: null
      start_ip_address: 192.168.1.1
      state: present
      subscription_id: null
      tenant: null

TASK [Assert check mode creation] *************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:54
Monday 04 March 2019  10:59:52 +0800 (0:00:02.815)       0:00:06.391 **********
ok: [localhost] => changed=false
  msg: All assertions passed

TASK [Create firewall rule] *******************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:59
Monday 04 March 2019  10:59:52 +0800 (0:00:00.057)       0:00:06.449 **********
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: yungez
<127.0.0.1> EXEC /bin/sh -c 'echo ~yungez && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119 `" && echo ansible-tmp-1551668393.0141082-235328291934119="` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119 `" ) && sleep 0'
Using module file /home/yungez/.ansible/roles/azure_preview_modules/library/azure_rm_rediscachefirewallrule.py
<127.0.0.1> PUT /home/yungez/.ansible/tmp/ansible-local-8449ywqf906r/tmp3pptytq6 TO /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119/AnsiballZ_azure_rm_rediscachefirewallrule.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119/ /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/yungez/src/ansible/venv/bin/python /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/yungez/.ansible/tmp/ansible-tmp-1551668393.0141082-235328291934119/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => changed=true
  id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/yungezrerdistest1/providers/Microsoft.Cache/redis/testredis1aa/firewallRules/myrule1
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      auth_source: null
      cache_name: testredis1aa
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      end_ip_address: 192.168.1.4
      name: myrule1
      password: null
      profile: null
      resource_group: yungezrerdistest1
      secret: null
      start_ip_address: 192.168.1.1
      state: present
      subscription_id: null
      tenant: null

TASK [Assert creation] ************************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:68
Monday 04 March 2019  10:59:58 +0800 (0:00:05.080)       0:00:11.529 **********
ok: [localhost] => changed=false
  msg: All assertions passed

TASK [Update firewall rule idempotence] *******************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:74
Monday 04 March 2019  10:59:58 +0800 (0:00:00.056)       0:00:11.586 **********
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: yungez
<127.0.0.1> EXEC /bin/sh -c 'echo ~yungez && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837 `" && echo ansible-tmp-1551668398.1490552-168668289871837="` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837 `" ) && sleep 0'
Using module file /home/yungez/.ansible/roles/azure_preview_modules/library/azure_rm_rediscachefirewallrule.py
<127.0.0.1> PUT /home/yungez/.ansible/tmp/ansible-local-8449ywqf906r/tmp45q08u30 TO /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837/AnsiballZ_azure_rm_rediscachefirewallrule.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837/ /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/yungez/src/ansible/venv/bin/python /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/yungez/.ansible/tmp/ansible-tmp-1551668398.1490552-168668289871837/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => changed=false
  id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/yungezrerdistest1/providers/Microsoft.Cache/Redis/testredis1aa/firewallRules/myrule1
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      auth_source: null
      cache_name: testredis1aa
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      end_ip_address: 192.168.1.4
      name: myrule1
      password: null
      profile: null
      resource_group: yungezrerdistest1
      secret: null
      start_ip_address: 192.168.1.1
      state: present
      subscription_id: null
      tenant: null

TASK [Assert idempotence] *********************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:83
Monday 04 March 2019  11:00:00 +0800 (0:00:02.675)       0:00:14.261 **********
ok: [localhost] => changed=false
  msg: All assertions passed

TASK [Update firewall rule] *******************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:88
Monday 04 March 2019  11:00:00 +0800 (0:00:00.056)       0:00:14.318 **********
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: yungez
<127.0.0.1> EXEC /bin/sh -c 'echo ~yungez && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110 `" && echo ansible-tmp-1551668400.8833194-261491128807110="` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110 `" ) && sleep 0'
Using module file /home/yungez/.ansible/roles/azure_preview_modules/library/azure_rm_rediscachefirewallrule.py
<127.0.0.1> PUT /home/yungez/.ansible/tmp/ansible-local-8449ywqf906r/tmpsd0erqwu TO /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110/AnsiballZ_azure_rm_rediscachefirewallrule.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110/ /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/yungez/src/ansible/venv/bin/python /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/yungez/.ansible/tmp/ansible-tmp-1551668400.8833194-261491128807110/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => changed=true
  id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/yungezrerdistest1/providers/Microsoft.Cache/redis/testredis1aa/firewallRules/myrule1
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      auth_source: null
      cache_name: testredis1aa
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      end_ip_address: 192.168.1.5
      name: myrule1
      password: null
      profile: null
      resource_group: yungezrerdistest1
      secret: null
      start_ip_address: null
      state: present
      subscription_id: null
      tenant: null

TASK [Assert updating] ************************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:96
Monday 04 March 2019  11:00:06 +0800 (0:00:05.314)       0:00:19.633 **********
ok: [localhost] => changed=false
  msg: All assertions passed

TASK [Delete firewall rule] *******************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:101
Monday 04 March 2019  11:00:06 +0800 (0:00:00.056)       0:00:19.690 **********
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: yungez
<127.0.0.1> EXEC /bin/sh -c 'echo ~yungez && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557 `" && echo ansible-tmp-1551668406.2560713-246717278807557="` echo /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557 `" ) && sleep 0'
Using module file /home/yungez/.ansible/roles/azure_preview_modules/library/azure_rm_rediscachefirewallrule.py
<127.0.0.1> PUT /home/yungez/.ansible/tmp/ansible-local-8449ywqf906r/tmpko28r8l1 TO /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557/AnsiballZ_azure_rm_rediscachefirewallrule.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557/ /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/yungez/src/ansible/venv/bin/python /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557/AnsiballZ_azure_rm_rediscachefirewallrule.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/yungez/.ansible/tmp/ansible-tmp-1551668406.2560713-246717278807557/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => changed=true
  id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/yungezrerdistest1/providers/Microsoft.Cache/Redis/testredis1aa/firewallRules/myrule1
  invocation:
    module_args:
      ad_user: null
      adfs_authority_url: null
      api_profile: latest
      auth_source: null
      cache_name: testredis1aa
      cert_validation_mode: null
      client_id: null
      cloud_environment: AzureCloud
      end_ip_address: null
      name: myrule1
      password: null
      profile: null
      resource_group: yungezrerdistest1
      secret: null
      start_ip_address: null
      state: absent
      subscription_id: null
      tenant: null

TASK [Assert deletion] ************************************************************************************************************************************************************************************
task path: /home/yungez/src/ansible-testapp/redis.yml:109
Monday 04 March 2019  11:00:11 +0800 (0:00:04.836)       0:00:24.527 **********
ok: [localhost] => changed=false
  msg: All assertions passed

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 4, 2019

@Madhura-CSI @brusMX @caohai @devigned @gustavomcarmo @haroldwongms @iphilpot @julienstroheker @lmazuel @obsoleted @sozercan @trstringer @tstringer @xscript @yaweiw @yuwzho

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@Fred-sun

This comment has been minimized.

Copy link
Contributor

Fred-sun commented Mar 4, 2019

@nitzmahone
Copy link
Member

nitzmahone left a comment

Module content looks fine, but we should probably do something a little different for the tests so they can be run manually without modification. Since there's one check-mode test that can run, I'm not sure what the best way to handle the disabled tests is... Ideally they wouldn't be commented out, just disabled conditionally for CI. @mattclay - do we have a sane way to pass a condition to ansible-test to manually enable a broader set of tests for a target?

@mattclay

This comment has been minimized.

Copy link
Member

mattclay commented Mar 6, 2019

@nitzmahone Probably the easiest option would be to use tags and pass the --tags option to ansible-test as needed to run the slow tests.

@Fred-sun

This comment has been minimized.

Copy link
Contributor

Fred-sun commented Mar 14, 2019

@mattclay Do you mean adding tags to the test? Thanks!

@ansibot ansibot added the stale_ci label Mar 14, 2019

@Fred-sun

This comment has been minimized.

Copy link
Contributor

Fred-sun commented Mar 18, 2019

@yuwzho Please help review this PR and push for forward! Thanks!

@nitzmahone
Copy link
Member

nitzmahone left a comment

switch commented out tests to use a tag instead, then +1

@yungezz

This comment has been minimized.

Copy link
Contributor Author

yungezz commented Mar 21, 2019

HI @mattclay could you pls share how to add tags to test? is it Azure resource tag? or some ansible tag? thanks in advance.

@ansibot ansibot removed the stale_ci label Mar 21, 2019

@yungezz

This comment has been minimized.

Copy link
Contributor Author

yungezz commented Mar 22, 2019

hi @mattclay I added tag long_run in test. Is it ok? Or let me know you have some specific tag for it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.