You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
PLAY [Create backup] ************************************************************************************************************************************************************************
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 [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]
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: