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

Disable Virtual Server requires profiles if not a Standard VS #2434

Open
jarcogna opened this issue Oct 30, 2024 · 1 comment
Open

Disable Virtual Server requires profiles if not a Standard VS #2434

jarcogna opened this issue Oct 30, 2024 · 1 comment
Labels
backlog Item logged internally bug Issues that are related to bugs in the Ansible modules

Comments

@jarcogna
Copy link

jarcogna commented Oct 30, 2024

If you simply want to disable a virtual server and the server type is standard, then the following works:
tasks:
- name: Disable VS
bigip_virtual_server:
name: vs_https
port: 443
state: "disabled"

However, if the type is performace-l4, you need to specify the profile

tasks:
- name: Disable VS
bigip_virtual_server:
name: vs_fastl4
port: 443
state: "disabled"
profiles:
- fastL4

This means you need to know what profile the the VS is using, as it will be changed to whatever profile is specified.

This kind of defeats the purpose of automation. I don't see why I need to specify a profile if the VS already exists.

We should be able to emulate the tmsh command: modify ltm virtual vs_fastl4 disable

COMPONENT NAME

bigip_virtual_server

Environment

ANSIBLE VERSION

# ansible --version
ansible [core 2.17.5]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.0.3
libyaml = True

BIGIP VERSION

v12+

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY
STEPS TO REPRODUCE

cat disable_vs_fastl4.yaml
...
tasks:
- name: Disable VS
bigip_virtual_server:
name: vs_fastl4
port: 443
state: "disabled"
provider: "{{ provider }}"
register: result

ubuntu-server:~# ansible-playbook disable_vs_fastl4.yaml

PLAY [Create backup] ************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [10.10.10.10]

TASK [Disable VS] ***************************************************************************************************************************************************************************
fatal: [10.10.10.10]: FAILED! => {"changed": false, "msg": "Changing the 'type' parameter is not supported."}

PLAY RECAP **********************************************************************************************************************************************************************************
10.10.10.10 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

EXPECTED RESULTS

VS vs_fastl4 should be disabled

ACTUAL RESULTS

VS vs_fastl4 should be disabled

WORKAROUND

cat disable_vs_tmsh.yaml
...
tasks:
- name: Disable VS
bigip_command:
commands: { modify ltm virtual vs_fastl4 disabled }
provider: "{{ provider }}"
register: result

This of course does get a warning, as there is a module for virtual servers:
ubuntu-server:~# ansible-playbook disable_vs_tmsh.yaml

PLAY [Create backup] ************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [10.10.10.10]

TASK [Disable VS] ***************************************************************************************************************************************************************************
[WARNING]: Using "write" commands is not idempotent. You should use a module that is specifically made for that. If such a module does not exist, then please file a bug. The command in
question is "modify ltm virtual vs_fastl4 disabled..."
changed: [10.10.10.10]

PLAY RECAP **********************************************************************************************************************************************************************************
10.10.10.10 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

@jarcogna jarcogna added bug Issues that are related to bugs in the Ansible modules untriaged issue that needs an initial response from the developers labels Oct 30, 2024
@pgouband
Copy link
Contributor

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1695.

@pgouband pgouband added backlog Item logged internally and removed untriaged issue that needs an initial response from the developers labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Item logged internally bug Issues that are related to bugs in the Ansible modules
Projects
None yet
Development

No branches or pull requests

2 participants