Giter VIP home page Giter VIP logo

f5-ansible's People

Contributors

andreykashcheev avatar buzzsurfr avatar caphrim007 avatar chen23 avatar crosbygw avatar dbanttari avatar delgadillo22 avatar focrensh avatar gabetellier avatar jmighion avatar josephpjordan avatar jputrino avatar kaustriaf5 avatar lopf avatar manuadoor avatar mgusek avatar nahun avatar nitinthewiz avatar papineni87 avatar pgouband avatar prateekramani avatar rafalkorepta avatar ravinderreddyf5 avatar ricksalsa avatar robcupples avatar simonkowallik avatar thejerrod avatar urohit011 avatar waffie1 avatar wojtek0806 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f5-ansible's Issues

Is change mode supported for Big-IP Ansible module?

Just wanted to see if the --check flag is enabled or supported in this module. I ran my playbook with this flag but didn't get a report of changes to be made or current state of the F5, which from the documentation would suggest this isn't enabled on this module hence the request for confirmation

bigip_command stripping tmsh

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_command

ANSIBLE VERSION
# ansible --version
ansible 2.2.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
PYTHON VERSION
# python -V
Python 2.7.6

BIGIP VERSION
# tmsh show sys version

Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       2.0.204
  Edition     Hotfix HF2
  Date        Fri Oct 21 17:35:48 PDT 2016

Hotfix List
ID613127-3    ID609325    ID598294-2  ID607857-1  ID608373-2  ID590578-4
ID603997      ID599033-3  ID622529    ID575170-5  ID575170-2  ID601927-1
ID604459-1    ID600859-3  ID604211-4  ID434573-6  ID585120-1  ID624264-2
ID603605-1    ID606110-4  ID590578-5  ID542097-3  ID589318-2  ID513851-2
ID594910-4    ID597309-2  ID585366-2  ID605314-2  ID603997-3  ID602653-3
ID561444-1    ID607200-1  ID590074-1  ID597708-4  ID601938-8  ID599769-1
ID600778-1    ID596674-1  ID608373-1  ID600778-2  ID606509-1  ID595394-2
ID605682-2    ID595394-4  ID623048    ID612952-1  ID598294-1  ID593355
ID596814-5    ID592716-1  ID606110-3  ID585366    ID599054-2  ID605682-3
ID614599      ID595064-1  ID601309    ID593355-2  ID513851-3  ID527403-1
ID618382-4    ID590608-1  ID589318-1  ID612564    ID599033-4  ID521270-1
ID610307      ID590608-3  ID606807-1  ID590074-2  ID599068-2  ID589149-2
ID595064-2    ID600859-4  ID606509-3  ID601938-2  ID585120-2  ID321971-1
ID594910-1    ID599769    ID599068-3  ID609677-1  ID599054-4  ID603605-2
ID604211-3    ID596814-9  ID602061    ID601927-8
CONFIGURATION

Uncommented below due to some errors with .ssh/known_hosts error in tower
----snip----

uncomment this to disable SSH key host checking

host_key_checking = False
----snip----

OS / ENVIRONMENT

Ubuntu 14.04.2 LTS

SUMMARY

Need to add two tmsh like "tmsh tmsh show sys version" or else following will result:
----snip----
TASK [bigip_command : debug] *************************************************** ok: [172.28.15.116] => {
"result.stdout_lines": [
[
"-bash: show: command not found"
]
]
}
----snip----

STEPS TO REPRODUCE
  1. Setup Ansible Tower 3.0.3 using
  2. Configure Inventory, credentials, and Job Template to talk to BIG-IP
  3. Grab the playbooks from https://github.com/F5Networks/f5-ansible
  4. Modify playbook for outputting to stdout_lines
  5. Run Job, note the bash error
- name: Test the bigip_command module
  hosts: bigips
  connection: local

  vars:
      cli:
          host: "{{ inventory_hostname }}"
          username: root
          password: default
#          port: 2222
  tasks:
    - name: Run show version on remote devices
      bigip_command:
          commands:
              - tmsh tmsh show sys version
          provider: "{{ cli }}"
      register: result
    - debug: var=result.stdout_lines

  roles:
      - bigip_command
EXPECTED RESULTS

Std out should look like below:

TASK [Run show version on remote devices] ************************************** ok: [172.28.15.116] TASK [debug] ******************************************************************* ok: [172.28.15.116] => {
"result.stdout_lines": [
[
"",
"Sys::Version",
"Main Package",
" Product BIG-IP",
" Version 12.1.1",
" Build 2.0.204",
" Edition Hotfix HF2",
" Date Fri Oct 21 17:35:48 PDT 2016",
"",
"Hotfix List",
"ID613127-3 ID609325 ID598294-2 ID607857-1 ID608373-2 ID590578-4",
"ID603997 ID599033-3 ID622529 ID575170-5 ID575170-2 ID601927-1",
"ID604459-1 ID600859-3 ID604211-4 ID434573-6 ID585120-1 ID624264-2",
"ID603605-1 ID606110-4 ID590578-5 ID542097-3 ID589318-2 ID513851-2",
"ID594910-4 ID597309-2 ID585366-2 ID605314-2 ID603997-3 ID602653-3",
"ID561444-1 ID607200-1 ID590074-1 ID597708-4 ID601938-8 ID599769-1",
"ID600778-1 ID596674-1 ID608373-1 ID600778-2 ID606509-1 ID595394-2",
"ID605682-2 ID595394-4 ID623048 ID612952-1 ID598294-1 ID593355",
"ID596814-5 ID592716-1 ID606110-3 ID585366 ID599054-2 ID605682-3",
"ID614599 ID595064-1 ID601309 ID593355-2 ID513851-3 ID527403-1",
"ID618382-4 ID590608-1 ID589318-1 ID612564 ID599033-4 ID521270-1",
"ID610307 ID590608-3 ID606807-1 ID590074-2 ID599068-2 ID589149-2",
"ID595064-2 ID600859-4 ID606509-3 ID601938-2 ID585120-2 ID321971-1",
"ID594910-1 ID599769 ID599068-3 ID609677-1 ID599054-4 ID603605-2",
"ID604211-3 ID596814-9 ID602061 ID601927-8",
""
]
]
}

ACTUAL RESULTS
SSH password: PLAY [Test the bigip_command module] ******************************************* TASK [setup] ******************************************************************* ok: [172.28.15.116] TASK [bigip_command : Run show version on remote devices] ********************** ok: [172.28.15.116] TASK [bigip_command : debug] *************************************************** ok: [172.28.15.116] => {
    "result.stdout_lines": [
        [
            "-bash: show: command not found"
        ]
    ]
} TASK [bigip_command : Run show sys clock] ************************************** ok: [172.28.15.116] TASK [bigip_command : debug] *************************************************** ok: [172.28.15.116] => {
    "result.stdout_lines": [
        [
            "-bash: show: command not found"
        ]
    ]
} TASK [bigip_command : Run list auth] ******************************************* ok: [172.28.15.116] TASK [bigip_command : debug] *************************************************** ok: [172.28.15.116] => {
    "result.stdout_lines": [
        [
            "-bash: list: command not found"
        ]
    ]
} 
----snip----

Problems with simplejson

This is first time I try this modules for F5, I was trying to run a module "bigip_command" and I'm receiving this error:

failed: [ltm1] => {"failed": true}
msg: Error: ansible requires the stdlib json or simplejson module, neither was found!

FATAL: all hosts have already failed -- aborting
This is my playbook:

- hosts: ltm1
  gather_facts: no
  tasks:
  - name: Run a command
    bigip_command:
     server: 192.168.200.200
     command: create node NODE1 address 1.1.1.21"
     password: XXXX

Another question: Do I have to specify the server again?
Thanks.

bigip_pool support description

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

bigip_pool

ANSIBLE VERSION

ansible 1.9.4


##### PYTHON VERSION
<!--- Paste verbatim output from “python -V” between quotes below -->
`Python 2.7.9`

BIGIP VERSION

Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       1.0.196
  Edition     Hotfix HF1
  Date        Wed Sep  7 17:48:09 PDT 2016

Hotfix List
ID593355      ID321971-1  ID589318-1  ID604211-3  ID599068-2  ID594910-1
ID585120-1    ID603997    ID513851-2  ID585366    ID589149-2  ID599054-2
ID601938-2    ID608373-2  ID606110-3  ID590074-1  ID575170-2  ID600778-1
ID598294-1    ID595394-2  ID605682-2  ID590608-1  ID596814-5  ID590578-4
ID601927-1    ID595064-1  ID600859-3  ID599033-3  ID527403-1  ID603605-1
ID614599      ID599769    ID606509-3


CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

Most modules allow us to update the description field. Not so with the bigip_pool module. Seems like an easy enhancement.

STEPS TO REPRODUCE
      - name: add and update pools
        bigip_pool:
            server: "{{ inventory_hostname }}"
            user: "{{ some_username }}"
            password: "{{ some_password }}"
            name: "{{ item.name }}"
            partition: "{{ item.partition }}"
            state: "present"
            **description: "{{ item.description }}"**
        with_items: "{{ poolstable }}"
        when: item.state == "present"

EXPECTED RESULTS

description of pool to be updated

ACTUAL RESULTS
TASK: [add and update pools] **************************************************
failed: [10.211.91.33] => (item={'state': 'present', 'partition': 'GEN', 'name': 'testpool', 'description': 'ansible test pool description'}) => {"failed": true, "item": {"description": "ansible test pool description", "name": "testpool", "partition": "GEN", "state": "present"}}
msg: unsupported parameter for module: description

FATAL: all hosts have already failed -- aborting


bigip_command documentation is obsolete and confuses

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

bigip_command

SUMMARY

Module documentation states you have to use the following format to connect:
http://f5-ansible.readthedocs.io/en/latest/modules/bigip_command_module.html
https://github.com/F5Networks/f5-ansible/blob/master/docs/modules/bigip_command_module.rst

  • name: Load the default system configuration
    bigip_command:
    server: "bigip.localhost.localdomain"
    user: "admin"
    password: "admin"
    command: "tmsh load sys config default"
    validate_certs: "no"
    delegate_to: localhost

While this codes won't work and return errors as bigip_command is not using AnsibleModule at all.

Instead, you have to use a structure like that:

  • name: Run command
    bigip_command:
    provider: "{{ cli }}"
    commands: "tmsh list auth user"

Which is in mentioned only in https://github.com/F5Networks/f5-ansible/blob/master/roles/bigip_command/tasks/issue-54.yaml

In summary, it confuses and takes a lot of time to figure out the problem.

I would much appreciate if module documentation is updated on wiki and git which is already in bigip_command.py :)

Thanks for great work!

bigip_user produced unhandled Python exception AdminRoleNoModifyError

ISSUE TYPE
  • Bug Report
COMPONENT NAME

F5 bigip (bigip_user)

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

When attempting to modify the root user's password using bigip_user, an unhandled Python exception is thrown with the error NameError: global name 'AdminRoleNoModifyError' is not defined.

NOTE: after running into this error, I noticed in the documentation that this module is only supported on BIGIP versions 13 and greater. Whether or not it is supported on the version of software I'm using, a reasonable error should be produced instead of an unhandled exception.

STEPS TO REPRODUCE

Create a task that uses the bigip_user to attempt to change the password of the root user. Additionally, the BIGIP software version being tested against may need to be lower than 13.x to produce this error.

- name: Set root user password
  bigip_user:
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    user: "{{ bigip_username }}"
    username_credential: "root"
    password_credential: "mysecret"
    validate_certs: "{{ validate_certs }}"
EXPECTED RESULTS

It should handle the AdminRoleNoModifyError exception and return a reasonable error message indicating the actual problem.

ACTUAL RESULTS

The Ansible task fails with the following error: NameError: global name 'AdminRoleNoModifyError' is not defined.

TASK [Set root user password] **************************************************
task path: /playbooks/ltm_bootstrap.yaml:9
Using module file /playbooks/library/bigip_user.py
<lbl12.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl12.example.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960 `" && echo ansible-tmp-1474561274.87-25040398694960="` echo $HOME/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960 `" ) && sleep 0'
<lbl12.example.com> PUT /tmp/tmpZGCFpX TO /root/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960/bigip_user.py
<lbl12.example.com> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960/ /root/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960/bigip_user.py && sleep 0'
<lbl12.example.com> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960/bigip_user.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1474561274.87-25040398694960/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_lYiZgE/ansible_module_bigip_user.py", line 714, in <module>
    main()
  File "/tmp/ansible_lYiZgE/ansible_module_bigip_user.py", line 689, in main
    except AdminRoleNoModifyError:
NameError: global name 'AdminRoleNoModifyError' is not defined

fatal: [lbl12.example.com]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_user"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_lYiZgE/ansible_module_bigip_user.py\", line 714, in <module>\n    main()\n  File \"/tmp/ansible_lYiZgE/ansible_module_bigip_user.py\", line 689, in main\n    except AdminRoleNoModifyError:\nNameError: global name 'AdminRoleNoModifyError' is not defined\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE"
}
        to retry, use: --limit @/playbooks/ltm_bootstrap.retry

bigip_virtual_server can not assign policies

ISSUE TYPE
  • Feature request
COMPONENT NAME

bigip_virtual_server.py

ANSIBLE VERSION
# ansible --version
ansible 2.3.0 (devel 0a86ddc251) last updated 2016/10/05 11:22:39 (GMT +200)
PYTHON VERSION
# python -V
Python 2.7.6
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     11.6.0
  Build       6.0.442
  Edition     Hotfix HF6
  Date        Tue Oct 27 16:12:46 PDT 2015
CONFIGURATION

standard, no changes

OS / ENVIRONMENT

Ubuntu 14.04 LTS

SUMMARY

When creating virtual server with this module, it's not possible to assign any policies.

EXPECTED RESULTS

Would be nice to have 'all_policies' parameter for that. Use case: assign http-to-https redirection (yes, I know it can be done with iRule, but since policies exists in F5 BIGIP it feels better to use them instead of iRules).

Update Module descriptions/synopsis

Hello,
I'd like to raise an issue for the purpose of updating the below modules with a proper description/synopsis.

bigip_dns_record_facts (E) - foo
bigip_iapp_service (E) - foo
bigip_iapp_template (E) - foo
bigip_snmp (E) - foo

bigip_virtual_server module fails on 2nd run without any changes

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

After creating a basic VIP with the bigip_virtual_server module, running ansible-playbook again without any changes produces the error:

received exception: Error on updating Virtual Server : Server raised fault: 'Exception caught in System::urn:iControl:System/Session::submit_transaction()\nException: Common::OperationFailed\n\tprimary_error_code   : 16908390 (0x01020066)\n\tsecondary_error_code : 0\n\terror_string         : 01020066:3: The requested virtual server profile (/Common/myvip /Common/http) already exists in partition Common.'
STEPS TO REPRODUCE

Create a task that uses the bigip_virtual_server module with the following configuration parameters:

- name: Create virtual server
  bigip_virtual_server:
    name: "myvip"
    destination: "1.1.1.1"
    port: 80
    pool: "mypool"
    snat: "Automap"
    description: "My VIP"
    all_profiles:
      - tcp
      - http
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    state: "present"
    user: "{{ bigip_username }}"
    validate_certs: "{{ validate_certs }}"
EXPECTED RESULTS

The bigip_virtual_server module should be able to be idempotently run multiple times without failing.

Example successful first run where VIP is created:

TASK [Create virtual server] ***************************************************
task path: /playbooks/ltm_application.yaml:60
Using module file /playbooks/library/bigip_virtual_server.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729 `" && echo ansible-tmp-1475010281.0-111683286869729="` echo $HOME/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729 `" ) && sleep 0'
<lbl11.example.com> PUT /tmp/tmpjnD4nv TO /root/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729/bigip_virtual_server.py
<lbl11.example.com> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729/ /root/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729/bigip_virtual_server.py && sleep 0'
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729/bigip_virtual_server.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1475010281.0-111683286869729/" > /dev/null 2>&1 && sleep 0'
changed: [lbl11.example.com] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "all_enabled_vlans": null,
            "all_profiles": [
                "tcp",
                "http"
            ],
            "all_rules": null,
            "default_persistence_profile": null,
            "description": "My VIP",
            "destination": "1.1.1.1",
            "name": "myvip",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "mypool",
            "port": 80,
            "server": "lbl11.example.com",
            "server_port": 443,
            "snat": "Automap",
            "state": "present",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    }
}
ACTUAL RESULTS

The second run fails with the error:

TASK [Create virtual server] ***************************************************
task path: /playbooks/ltm_application.yaml:60
Using module file /playbooks/library/bigip_virtual_server.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538 `" && echo ansible-tmp-1475010324.6-231119371673538="` echo $HOME/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538 `" ) && sleep 0'
<lbl11.example.com> PUT /tmp/tmpdwEbcr TO /root/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538/bigip_virtual_server.py
<lbl11.example.com> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538/ /root/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538/bigip_virtual_server.py && sleep 0'
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538/bigip_virtual_server.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1475010324.6-231119371673538/" > /dev/null 2>&1 && sleep 0'
fatal: [lbl11.example.com]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "all_enabled_vlans": null,
            "all_profiles": [
                "tcp",
                "http"
            ],
            "all_rules": null,
            "default_persistence_profile": null,
            "description": "My VIP",
            "destination": "1.1.1.1",
            "name": "myvip",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "mypool",
            "port": 80,
            "server": "lbl11.example.com",
            "server_port": 443,
            "snat": "Automap",
            "state": "present",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    },
    "msg": "received exception: Error on updating Virtual Server : Server raised fault: 'Exception caught in System::urn:iControl:System/Session::submit_transaction()\nException: Common::OperationFailed\n\tprimary_error_code   : 16908390 (0x01020066)\n\tsecondary_error_code : 0\n\terror_string         : 01020066:3: The requested virtual server profile (/Common/myvip /Common/http) already exists in partition Common.'"
}
        to retry, use: --limit @/playbooks/ltm_application.retry

JSON Formatted Playbook

Hi - I'm working a way to generate our playbooks dynamically and am wanting to format them in JSON instead of YAML. I've pretty much figured out how to do this, but am running into issues when I try to include the parameters specified in the module (ex. server, user, etc.) as a list value to a dictionary key (specifically I'm told that the parameter doesn't support a list). Do you have any insight on how these parameters are formatted so that I can translate them to Python and subsequently into JSON? I'm testing with the bigip_node module but would eventually need to use all module parameters. It looked like the YAML was a list containing a dictionary containing a list but when I try to emulate that in Python I get the error mentioned above. Thanks!

Module Template

Between different versions of BIG-IP, SOAP/REST, and differing python modules--it's difficult to determine where to start writing a new module. There's different versions of the module framework present throughout the modules.

There needs to be a template to distinguish how to tie all the components together, and separate some of the logic between the API call and the method used. Possibly include a guidelines page to determine whether a feature meets the criteria for using one template over another (e.g. a feature in SOAP not in REST, etc.).

bigip_selfip fails when using traffic_group parameter

ISSUE TYPE
  • Bug Report
COMPONENT NAME

F5 bigip (bigip_selfip)

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
PYTHON VERSION
Python 2.7.12
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

If the traffic_group parameter in the bigip_selfip module is set to a valid traffic group that exists on the remote device such as traffic-group-local-only or traffic-group-1, the bigip_selfip module will always return the error: The specified traffic group was not found.

STEPS TO REPRODUCE

Create a task that uses the bigip_selfip module and specify a valid traffic_group parameter.

NOTE: The default traffic group traffic-group-local-only will always exist, and the traffic group traffic-group-1 will be automatically created during the process of configuring device HA through the HA Wizard.

- name: Assign Floating IP to external
  bigip_selfip:
    address: "1.1.1.1"
    name: "external_floating"
    netmask: "255.255.255.0"
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    traffic_group: "traffic-group-1"
    user: "{{ bigip_username }}"
    validate_certs: "{{ validate_certs }}"
    vlan: "external"
EXPECTED RESULTS

It should set the self ip's traffic group to the valid traffic group specified.

ACTUAL RESULTS

The Ansible task fails with the following error: The specified traffic group was not found.

TASK [Assign Floating IP to internal] ******************************************
task path: /site/site.yaml:96
Using module file /site/library/bigip_selfip.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314 `" && echo ansible-tmp-1474482164.33-122340317119314="` echo $HOME/.ansibl
e/tmp/ansible-tmp-1474482164.33-122340317119314 `" ) && sleep 0'
<lbl11.example.com> PUT /tmp/tmpo34T9a TO /root/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314/bigip_selfip.py
<lbl11.example.com> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314/ /root/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314/bigip_selfip.py && sleep 0'
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314/bigip_selfip.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1474482164.33-122340317119314/" >
 /dev/null 2>&1 && sleep 0'
fatal: [lbl11.example.com]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "address": "10.11.50.9",
            "allow_service": null,
            "name": "internal_floating",
            "netmask": "255.255.254.0",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "server": "lbl11.example.com",
            "server_port": 443,
            "state": "present",
            "traffic_group": "traffic-group-1",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false,
            "vlan": "internal"
        },
        "module_name": "bigip_selfip"
    },
    "msg": "The specified traffic group was not found"
}
        to retry, use: --limit @/site/site.retry

bigip_vlan

Hi

I installed latest f5-ansible and f5-common-python today and get this.
An other older installation works.

Regards
Christer

ansible-playbook -vvv f5-make.yml
Using /etc/ansible/ansible.cfg as config file

PLAYBOOK: f5-make.yml **********************************************************
3 plays in f5-make.yml

PLAY [Deploy customer in loadbalancer] *****************************************

PLAY [Create VLAN in I LB] ***************************************************

TASK [Add vlan on pod LB trunk (vPC37)] ****************************************
task path: /home/xx/dev/f5-make.yml:25
ESTABLISH LOCAL CONNECTION FOR USER: xx
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo $HOME/.ansible/tmp/ansible-tmp-1466715236.73-198574109131084" && echo ansible-tmp-1466715236.73-198574109131084="echo $HOME/.ansible/tmp/ansible-tmp-1466715236.73-198574109131084" ) && sleep 0'
PUT /tmp/tmpT16MCc TO /home/xx/.ansible/tmp/ansible-tmp-1466715236.73-198574109131084/bigip_vlan
EXEC /bin/sh -c 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/xx/.ansible/tmp/ansible-tmp-1466715236.73-198574109131084/bigip_vlan; rm -rf "/home/xx/.ansible/tmp/ansible-tmp-1466715236.73-198574109131084/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 210, in
main()
File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 199, in main
obj = BigIpVlan(**module.params)
File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 120, in init
port=kwargs['server_port'])
KeyError: 'server_port'

fatal: [i-p0-lb01]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "bigip_vlan"}, "module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 210, in \n main()\n File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 199, in main\n obj = BigIpVlan(**module.params)\n File "/tmp/ansible_lkoqBq/ansible_module_bigip_vlan.py", line 120, in init\n port=kwargs['server_port'])\nKeyError: 'server_port'\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

Random exceptions for set_session_enabled_state

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_node

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     11.6.0
  Build       0.0.401
  Edition     Final
  Date        Mon Aug 11 21:08:03 PDT 2014
CONFIGURATION
OS / ENVIRONMENT

Red Hat 7.2

SUMMARY

Occasionally when trying to enable or disable a node the bigip_node module will produce an exception and the entire playbook stops.

STEPS TO REPRODUCE
    - name: disable node on primary F5
      bigip_node: server='192.168.x.x'
                  user='ansible'
                  password='password'
                  name='test_node'
                  session_state=disabled
                  monitor_state=disabled
                  validate_certs=False
      register: f5_result
EXPECTED RESULTS

The node is disabled and any exceptions are handled within the module. The register variable should hold any errors trying to modify the node.

ACTUAL RESULTS

This doesn't happen all the time and it's hard to reproduce. I would like to be able to trap these errors and handle them gracefully in the playbook.

fatal: [app1 -> jumpserver]: FAILED! => {"changed": false, "failed": true, "msg": "received exception: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/NodeAddressV2::set_session_enabled_state()\nException: Common::OperationFailed\n\tprimary_error_code   : 17241203 (0x01071473)\n\tsecondary_error_code : 0\n\terror_string         : 01071473:3: Create, modify, and delete commands are not valid for (by class: node_address) while in the root folder.'"}

bigip_software not working on ve

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_software

ANSIBLE VERSION
ansible 2.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

Error when attempting to use bigip_software to update partition

STEPS TO REPRODUCE
#
# vim: ts=2 sts=2 sw=2 et:

- hosts: bigip-hosts
  vars:
  connection: local
  tasks:
    - bigip_software:
        password: "{{ bigip_password }}"
        server: "{{ inventory_hostname }}"
        user: "{{ bigip_username }}"
        validate_certs: "{{ validate_certs }}"
        software: "/root/BIGIP-12.1.1.0.0.184.iso"
        hotfix: "/root/Hotfix-BIGIP-12.1.1.1.0.196-HF1.iso"
        reuse_inactive_volume: yes
        state: "installed"
EXPECTED RESULTS

Software and hotfix to be applied to newly created partition

ACTUAL RESULTS
ASK [bigip_software] ************************************************************************************************************************************************
task path: /playbooks/bigip_software.yaml:10
Using module file /playbooks/library/bigip_software.py
<hostname.here> ESTABLISH LOCAL CONNECTION FOR USER: root
<hostname.here> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_CWDMRh/ansible_module_bigip_software.py", line 1130, in <module>
    main()
  File "/tmp/ansible_CWDMRh/ansible_module_bigip_software.py", line 1111, in main
    except ActiveVolumeError:
NameError: global name 'ActiveVolumeError' is not defined

fatal: [hostname.here]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_software"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_CWDMRh/ansible_module_bigip_software.py\", line 1130, in <module>\n    main()\n  File \"/tmp/ansible_CWDMRh/ansible_module_bigip_software.py\", line 1111, in main\n    except ActiveVolumeError:\nNameError: global name 'ActiveVolumeError' is not defined\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE"
}
	to retry, use: --limit @/playbooks/bigip_software.retry

PLAY RECAP ***********************************************************************************************************************************************************
lhostname.here     : ok=1    changed=0    unreachable=0    failed=1

[feature] bigip_monitor_external.py

ISSUE TYPE
  • Feature request
COMPONENT NAME

bigip_monitor_external.py

ANSIBLE VERSION
# ansible --version
ansible 2.3.0 (devel 0a86ddc251) last updated 2016/10/05 11:22:39 (GMT +200)
PYTHON VERSION
# python -V
Python 2.7.6
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     11.6.0
  Build       6.0.442
  Edition     Hotfix HF6
  Date        Tue Oct 27 16:12:46 PDT 2015
CONFIGURATION

standard, no changes

OS / ENVIRONMENT

Ubuntu 14.04 LTS

SUMMARY

This is a feature request. Please provide method for creating external type of monitors (Local Traffic->Monitors->Create->Type:External).

EXPECTED RESULTS

Most of such monitors are created after uploading some files to F5. This is an interesting part as my ansible roles fails to do that due to missing simplejson packages on F5 side and I really don't want to mess with it and installing it there. Thought about using API calls compatible with v11.6.x (do you know curl command that could achieve that?).

Next, uploaded file can be chosen from 'External Program'. This can be shell script or something else. With that ready, user should be able to supply:

  • name (required)
  • type of monitor (external by default)
  • parent monitor
  • interval
  • timeout
  • external program
  • arguments
  • variables:
    • name
    • value

bigip_dns_record not complete

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_dns_record

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     11.6.0
  Build       0.0.401
  Edition     Final
  Date        Mon Aug 11 21:08:03 PDT 2014
CONFIGURATION
OS / ENVIRONMENT

Red Hat 7.2

SUMMARY

There are a few objects missing from the module. Also the documentation in the module doesn't line up with the code.

STEPS TO REPRODUCE

On a related note, it seems the module documentation expects the F5 hostname to be the "server" parameter whereas the code expects "hostname". Same thing with "options: hostname". The documentation expects to see "options: domain_name".

var_file:

f5_dns:
  jhane.myzone:
    f5: 10.1.10.2
    type: A
    view: myview
    zone: myzone.
    ip_address: 10.10.10.10

Task:

  - name: add dns entry
    bigip_dns_record:
      user: "{{ f5_user }}"
      password: "{{ f5_password }}"
      server: "{{ item.value.f5 }}"
      type: "{{ item.value.type }}"
      view: "{{ item.value.view }}"
      zone: "{{ item.value.zone }}"
      state: "{{ item.value.state | default('present') }}"
      options:
        domain_name: "{{ item.key }}"
        ip_address: "{{ item.value.ip_address }}"
    with_dict: "{{ f5_dns }}"
    delegate_to: localhost
EXPECTED RESULTS

DNS entry to be created in the zone

ACTUAL RESULTS

It seems the BigIpApiFactory object isn't located in this module.

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible__BNVgm/ansible_module_bigip_dns_record.py", line 532, in <module>
    main()
  File "/tmp/ansible__BNVgm/ansible_module_bigip_dns_record.py", line 501, in main
    obj = BigIpApiFactory.factory(module)
NameError: global name 'BigIpApiFactory' is not defined

After I copied it from another module it then complained about missing the flush method.

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_PwyWtS/ansible_module_bigip_dns_record.py", line 548, in <module>
    main()
  File "/tmp/ansible_PwyWtS/ansible_module_bigip_dns_record.py", line 518, in main
    result = obj.flush()
AttributeError: 'NoneType' object has no attribute 'flush'

move route advertisement to bigip_virtual_address module

this was merged here

#20

but after talking to shun it's clear that this should be part of a bigip_virtual_address module because there are situations where you may in-deliberately change the existing VA configuration by accidentally creating a new VS with the same VA and, for example, unsetting route advertisement.

@mgusek we need to change this upstream. fyi because this is likely to break your playbook.

Route Domain inside a partition

ISSUE TYPE
  • Bug Report?
COMPONENT NAME

bigip_routedomain

ANSIBLE VERSION

ansible 2.2.0.0

BIGIP VERSION

Main Package
Product BIG-IP
Version 12.0.0
Build 1.0.628
Edition Hotfix HF1
Date Tue Dec 22 13:18:00 PST 2015

Hello,
I have already a partition:

    - name: "Crea la partizione"
      bigip_partition:
        server: "..."
        user: "..."
        password: "..."
        validate_certs: "no"
        name: "APS_PARTITION"
        description: "..."
        state: "present"

Using the GUI, I select the partition from the upper right dropdown and then I create a default route domain only for that partition. What I'm trying to get is this:
pic1

Now, this task

    - name: "Crea un Route Domain"
      bigip_routedomain:
        server: "..."
        user: "..."
        password: "..."
        validate_certs: "no"
        id: "10"
        description: "..."
        state: "present"
      ignore_errors: True

will create the R.D. "10" for all partitions not just for "APS_PARTITION". How can I achieve it?

R

bigip_irule module not idempotent in ansible 2.1

I know that ansible 2.1 isn't a stable release yet, but there are some bug fixes for f5 extras modules that are necessary. However, when switching from 1.9.4 to 2.1, idempotence no longer works. This happens with the most basic level:

  • name: Create testproduct iRules
    local_action: >
    bigip_irule
    name=testproduct1_irule
    content="{{ lookup('file', 'testproduct1_irule.tcl') }}"
    server=f5server
    user=user
    password=secret
    module=ltm
    state=present
    validate_certs=False

bigip_command fails to run

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_command

ANSIBLE VERSION
ansible 2.2.0
PYTHON VERSION
Python 2.7.11
BIGIP VERSION
11.5.1
CONFIGURATION
[defaults]
hostfile = hosts
remote_user = admin
host_key_checking = False
ask_pass=False
OS / ENVIRONMENT

OS X, 10.11.6
Ansible was installed following http://f5-ansible.readthedocs.io/en/latest/usage/getting_started.html
pip install virtualenv
virtualenv ansible2
. ansible2/bin/activate
pip install git+git://github.com/ansible/ansible.git@devel

Also, I download all 'library' files from this repo and copy it into my structure.
$ ls -1
ansible.cfg
ansible2/
candidate_config.txt
hosts
library/
test_f5_cli.yml

$ ls library/
library/:
init.py bigip_dns_record.py bigip_gtm_facts.py bigip_iapp_template.py bigip_node.py bigip_routedomain.py bigip_software.py bigip_ucs.py bigip_virtual_server.py
bigip_command.py bigip_dns_record_facts.py bigip_gtm_virtual_server.py bigip_irule.py bigip_partition.py bigip_routedomain_facts.py bigip_software_update.py bigip_ucs_fetch.py bigip_vlan.py
bigip_device_dns.py bigip_dns_zone.py bigip_gtm_wide_ip.py bigip_license.py bigip_pool.py bigip_selfip.py bigip_ssl_certificate.py bigip_user.py
bigip_device_ntp.py bigip_facts.py bigip_hostname.py bigip_monitor_http.py bigip_pool_member.py bigip_service.py bigip_sys_db.py bigip_user_facts.py
bigip_device_sshd.py bigip_gtm_datacenter.py bigip_iapp_service.py bigip_monitor_tcp.py bigip_provision.py bigip_snmp.py bigip_sys_global.py bigip_view.py

SUMMARY
STEPS TO REPRODUCE

Run playbook version 1 or version 2. They both fail with different messages. I am confused which one I should use and why it fails.

I am trying to execute a playbook according to https://f5-ansible.readthedocs.io/en/latest/modules/bigip_command_module.html

My playbook version 1:


---
- hosts: f5
  gather_facts: false

  tasks:
  - name: List SSH config
    bigip_command:
      server: "{{ device_hostname | default(inventory_hostname) }}"
      user: "{{ ansible_user }}"
      password: "{{ ansible_password }}"
      command: "tmsh list sys ssh"
      validate_certs: "no"

My playbook version 2 (with 'delegate_to: localhost' option):


---
- hosts: f5
  gather_facts: false

  tasks:
  - name: List SSH config
    bigip_command:
      server: "{{ device_hostname | default(inventory_hostname) }}"
      user: "{{ ansible_user }}"
      password: "{{ ansible_password }}"
      command: "tmsh list sys ssh"
      validate_certs: "no"
    delegate_to: localhost
EXPECTED RESULTS

I expect to get a result of 'tmsh list sys ssh':
sys sshd { }

ACTUAL RESULTS

Playbooks fail.

Version 1 fails with

$ ansible-playbook test_f5_cli.yml -vvvv
Using /Users/user1/git/ansible2/playbooks/ansible.cfg as config file
Loading callback plugin default of type stdout, v2.0 from /Users/user1/git/ansible2/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: test_f5_cli.yml ******************************************************
1 plays in test_f5_cli.yml

PLAY [f5] **********************************************************************

TASK [List SSH config] *********************************************************
task path: /Users/user1/git/ansible2/playbooks/test_f5_cli.yml:6
Using module file /Users/user1/git/ansible2/playbooks/library/bigip_command.py
<f5-box> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO f5-box
<f5-box> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837 `" && echo ansible-tmp-1473124050.61-152768438252837="` echo $HOME/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837 `" ) && sleep 0'
<f5-box> PUT /var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/tmpAnJPrq TO /root/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837/bigip_command.py
<f5-box> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837/ /root/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837/bigip_command.py && sleep 0'
<f5-box> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837/bigip_command.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1473124050.61-152768438252837/" > /dev/null 2>&1 && sleep 0'
fatal: [f5-box]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_command"
    },
    "module_stderr": "",
    "module_stdout": "  File \"/tmp/ansible_llZvdf/ansible_module_bigip_command.py\", line 237\r\n    except paramiko.ssh_exception.SSHException as e:\r\n                                                ^\r\nSyntaxError: invalid syntax\r\n",
    "msg": "MODULE FAILURE"
}
        to retry, use: --limit @test_f5_cli.retry

PLAY RECAP *********************************************************************
f5-box                     : ok=0    changed=0    unreachable=0    failed=1

Version 2 fails with

$ time ansible-playbook test_f5_cli.yml -vvvv
Using /Users/user1/git/ansible2/playbooks/ansible.cfg as config file
Loading callback plugin default of type stdout, v2.0 from /Users/user1/git/ansible2/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: test_f5_cli.yml ******************************************************
1 plays in test_f5_cli.yml

PLAY [f5] **********************************************************************

TASK [List SSH config] *********************************************************
task path: /Users/user1/git/ansible2/playbooks/test_f5_cli.yml:6
Using module file /Users/user1/git/ansible2/playbooks/library/bigip_command.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user1
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818 `" && echo ansible-tmp-1473124154.18-20181639279818="` echo $HOME/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818 `" ) && sleep 0'
<localhost> PUT /var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/tmpn17ZLp TO /Users/user1/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818/bigip_command.py
<localhost> EXEC /bin/sh -c 'chmod u+x /Users/user1/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818/ /Users/user1/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818/bigip_command.py && sleep 0'
<localhost> EXEC /bin/sh -c '/Users/user1/git/ansible2/bin/python2.7 /Users/user1/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818/bigip_command.py; rm -rf "/Users/user1/.ansible/tmp/ansible-tmp-1473124154.18-20181639279818/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py", line 247, in <module>
    main()
  File "/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py", line 230, in main
    result = obj.flush()
  File "/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py", line 180, in flush
    if self.appliance_mode():
  File "/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py", line 144, in appliance_mode
    headers=headers)
  File "/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)

fatal: [f5-box -> localhost]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_command"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py\", line 247, in <module>\n    main()\n  File \"/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py\", line 230, in main\n    result = obj.flush()\n  File \"/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py\", line 180, in flush\n    if self.appliance_mode():\n  File \"/var/folders/4k/lxknkpkn0wg4bmmjwrmb5b8mk_gp_p/T/ansible_E2fr6o/ansible_module_bigip_command.py\", line 144, in appliance_mode\n    headers=headers)\n  File \"/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/api.py\", line 70, in get\n    return request('get', url, params=params, **kwargs)\n  File \"/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/api.py\", line 56, in request\n    return session.request(method=method, url=url, **kwargs)\n  File \"/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/sessions.py\", line 475, in request\n    resp = self.send(prep, **send_kwargs)\n  File \"/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/sessions.py\", line 596, in send\n    r = adapter.send(request, **kwargs)\n  File \"/Users/user1/git/ansible2/lib/python2.7/site-packages/requests/adapters.py\", line 497, in send\n    raise SSLError(e, request=request)\nrequests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE"
}
        to retry, use: --limit @test_f5_cli.retry

PLAY RECAP *********************************************************************
f5-box                     : ok=0    changed=0    unreachable=0    failed=1

Also, I don't understand why SSLV3_ALERT_HANDSHAKE_FAILURE happens as paramiko is SSH client and should SSH into the box, not establishing HTTPS connection.

What am I missing here?

Please help.

bigip_irule module does not run idempotently when content or src ends in a newline

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_irule

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

The bigip_irule module is not idempotent when the irule content ends in newline (\n). The resource is changed every single time it's run. This applies to both the content and src parameters.

If the content parameter is used, but the string does not end in a newline, it works correctly and will not continue to change the irule in subsequent runs.

STEPS TO REPRODUCE

Create a task that uses the bigip_irule module with the following configuration parameters:

- name: Manage iRules
  bigip_irule:
    module: "ltm"
    name: "myirule"
    content: "when HTTP_REQUEST {HTTP::respond 200 content 'Good Request'}\n"
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    state: "present"
    user: "{{ bigip_username }}"
    validate_certs: "{{ validate_certs }}"

Alternatively, create a template file containing the same content and use the src parameter instead of the content parameter.

EXPECTED RESULTS

The bigip_irule module should create the irule, reporting changed=true, and on subsequent runs report changed=false.

ACTUAL RESULTS

The iRule is changed on every run.

Example of creation
Using module file /playbooks/library/bigip_irule.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
changed: [lbl11.example.com] => {
    "changed": true,
    "content": "when HTTP_REQUEST {HTTP::respond 200 content 'Good Request'}\n",
    "invocation": {
        "module_args": {
            "content": "when HTTP_REQUEST {HTTP::respond 200 content 'Good Request'}\n",
            "module": "ltm",
            "name": "myirule",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "server": "lbl11.example.com",
            "server_port": 443,
            "src": null,
            "state": "present",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        },
        "module_name": "bigip_irule"
    },
    "name": "myirule",
    "partition": "Common"
}

PLAY RECAP *********************************************************************
lbl11.example.com     : ok=2    changed=1    unreachable=0    failed=0

Second run after successful creation
Using module file /playbooks/library/bigip_irule.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
changed: [lbl11.example.com] => {
    "changed": true,
    "content": "when HTTP_REQUEST {HTTP::respond 200 content 'Good Request'}\n",
    "invocation": {
        "module_args": {
            "content": "when HTTP_REQUEST {HTTP::respond 200 content 'Good Request'}\n",
            "module": "ltm",
            "name": "myirule",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "server": "lbl11.example.com",
            "server_port": 443,
            "src": null,
            "state": "present",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        },
        "module_name": "bigip_irule"
    },
    "name": "myirule",
    "partition": "Common"
}

PLAY RECAP *********************************************************************
lbl11.example.com     : ok=2    changed=1    unreachable=0    failed=0

testing and usage of the ssl_certificate module

There has been a fairly significant refactor of the ssl_certificate module to allow for modifying certs in place. Additionally, some argument names have changed to meet ansible-isms that are commonly used.

@waffie1 I'd like to make sure that these changes still offer a consistent user experience for you. Can you test them? In the roles/__bigip_ssl_certificate/tasks/main.yaml file you can find example usages.

bigip_facts not working

Hi,

When I try to get facts from a BIG-IP system using the f5-ansible module, I get the following error:

sudo ansible-playbook bigip_facts.yml

PLAY [Test bigip_facts] ********************************************************

TASK [setup] *******************************************************************
ok: [x.x.x.x]

TASK [Get all facts from BIG-IP] ***********************************************
fatal: [x.x.x.x]: FAILED! => {"changed": false, "failed": true, "msg": "received exception: object of type 'itertools.imap' has no len()\ntraceback: Traceback (most recent call last):\n  File \"/tmp/ansible_vtXdNG/ansible_module_bigip_facts.py\", line 1657, in main\n    if len(include) > 0:\nTypeError: object of type 'itertools.imap' has no len()\n"}
        to retry, use: --limit @bigip_facts.retry

PLAY RECAP *********************************************************************
x.x.x.x             : ok=1    changed=0    unreachable=0    failed=1

Here my playbook:


---
- name: Test bigip_facts
  hosts: x.x.x.x
  connection: local

  tasks:
    - name: Get all facts from BIG-IP
      bigip_facts:
        server: "x.x.x.x"
        user: "admin"
        password: "xxxxxx"
        include: "system_info"

Thank you.

bigip_virtual_server does not allow valid port number of 0 (zero)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/library/', '/usr/share/ansible/']

PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       1.0.196
  Edition     Hotfix HF1
  Date        Wed Sep  7 17:48:09 PDT 2016

Hotfix List
ID593355      ID321971-1  ID589318-1  ID604211-3  ID599068-2  ID594910-1
ID585120-1    ID603997    ID513851-2  ID585366    ID589149-2  ID599054-2
ID601938-2    ID608373-2  ID606110-3  ID590074-1  ID575170-2  ID600778-1
ID598294-1    ID595394-2  ID605682-2  ID590608-1  ID596814-5  ID590578-4
ID601927-1    ID595064-1  ID600859-3  ID599033-3  ID527403-1  ID603605-1
ID614599      ID599769    ID606509-3
CONFIGURATION
OS / ENVIRONMENT

“N/A”

SUMMARY

Port 0 (zero) is a valid port number for a virtual server. It designates "any" port.
When using a 0 for the port number it fails and gives an error.

The "if" statement at about line 696 ( "if (not destination) or (not port):") should probably check instead that "port" is a number between 0 and 65535.
"not port" is evaluating to "true" if port is 0

STEPS TO REPRODUCE
      - name: Add update delete virtual servers
        bigip_virtual_server:
            server: "server1"
            user: "admin"
            password: "password"
            name: "testVS"
            state: "present"
            destination: "1.2.3.4"
            port: "0"

EXPECTED RESULTS
A virtual server to be created with a port of Any.
ACTUAL RESULTS
failed: [10.201.97.32] (item={u'routeadvertisement': u'enabled', u'name': u'testVS', u'partition': u'GEN', u'state': u'present', u'address': u'1.2.3.4', u'port': u'0', u'pool': u'', u'description': u'test VS'}) => {"failed": true, "item": {"address": "1.2.3.4", "description": "test VS", "name": "testVS", "partition": "GEN", "pool": "", "port": "0", "routeadvertisement": "enabled", "state": "present"}, "msg": "both destination and port must be supplied to create a VS"}

bigip_selfip in RD

Hi

The bigip_vlan have the option to add vlan in Route_domain.
But i missing the option to add selfip in Route_domain.

From bigsuds script.

b.Management.Partition.set_default_route_domain(partitions = ['LB-EXT'],route_domains = ['7'])

b.Management.Partition.set_active_partition('LB-EXT')

print "# Set Vlan IP:"
print(b.Networking.SelfIPV2.get_list())
b.Networking.SelfIPV2.create(self_ips = ['vlan7'],vlan_names = ['vlan7'],addresses = ['1.1.1.2'],netmasks = ['255.255.255.248'],traffic_groups = ['traffic-group-local-only'],floating_state
s = ['STATE_DISABLED'])

print(b.Networking.SelfIPV2.get_list())

print "# Set Vlan-vip IP:"
b.Networking.SelfIPV2.create(self_ips = ['vlan7-vip'],vlan_names = ['vlan7'],addresses = ['1.1.1.1'],netmasks = ['255.255.255.248'],traffic_groups = ['traffic-group-1'],floating_states = [
'STATE_DISABLED'])
print(b.Networking.SelfIPV2.get_list())

regards
Christer

bigip_software BigIpCommon#iso_info does not return result

Line 571 of bigip_software.py does not return result to collar that causes failure installtion. Adding 'return result' to the function seem to fix the issue.

Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 2827, in <module>
    main()
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 1096, in main
    result = obj.flush()
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 587, in flush
    changed = self.activated()
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 848, in activated
    if self.is_activated() and volume == self.get_active_volume():
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 699, in is_activated
    return self.software_active(True)
  File "/root/.ansible/tmp/ansible-tmp-1457994186.08-15355698835389/bigip_software", line 740, in software_active
    pbuild = psoftware['build']
TypeError: 'NoneType' object has no attribute '__getitem__'

Bigip_rd

Hi

A bigip_Rd/routedomain module would be great for mssp environment.

Regards
Christer

Bigip_command failed paramiko

ISSUE TYPE
  • Bug Report
  • Feature Idea
  • Documentation Report
COMPONENT NAME
ANSIBLE VERSION
2.2
PYTHON VERSION
2.7.12
BIGIP VERSION
11.6.1
CONFIGURATION
OS / ENVIRONMENT

List of packages installed:
ansible (2.2.0.0)
bigsuds (1.0.4)
cffi (1.9.1)
cryptography (1.6)
enum34 (1.1.6)
f5-icontrol-rest (1.1.0)
f5-sdk (2.1.0)
idna (2.1)
ipaddress (1.0.17)
Jinja2 (2.8)
MarkupSafe (0.23)
ordereddict (1.1)
paramiko (2.0.2)
pip (9.0.1)
pyasn1 (0.1.9)
pycparser (2.17)
pycrypto (2.6.1)
PyYAML (3.12)
requests (2.12.3)
setuptools (30.0.0)
six (1.10.0)
suds (0.4)
wheel (0.30.0a0)

SUMMARY

Received Error:
TASK [f5_command : Run a command] **********************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name 'paramiko' is not defined
fatal: [MABLT1-MFW2 -> None]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File "/var/folders/qz/j01vhkzs5ygddswn06812y54zy407f/T/ansible_K7Ow8O/ansible_module_bigip_command.py", line 246, in \n main()\n File "/var/folders/qz/j01vhkzs5ygddswn06812y54zy407f/T/ansible_K7Ow8O/ansible_module_bigip_command.py", line 236, in main\n except paramiko.ssh_exception.SSHException as e:\nNameError: global name 'paramiko' is not defined\n", "module_stdout": "", "msg": "MODULE FAILURE"}

STEPS TO REPRODUCE

Created a environment,

Created a f5-comand role
Import the library
run the playbook
Dry-run thru: https://github.com/F5Networks/f5-ansible

EXPECTED RESULTS
ACTUAL RESULTS

Traffic group for self ip

ISSUE TYPE
  • Bug Report?
COMPONENT NAME

bigip_selfip

ANSIBLE VERSION

ansible 2.2.0.0

BIGIP VERSION

Main Package
Product BIG-IP
Version 12.0.0
Build 1.0.628
Edition Hotfix HF1
Date Tue Dec 22 13:18:00 PST 2015

Hello,
I have a partition and inside it I need to configure as the picture:
a1

    - name: Add VLAN xxx as tagged to interface yyy
      bigip_selfip:
          server: "..."
          user: "..."
          password: "..."
          validate_certs: "no"
          name: "{{self_ip.name}}"   
          address: "{{self_ip.ip_address}}"   
          netmask: "{{self_ip.netmask}}"   
          vlan: "{{self_ip.vlan_tunnel}}"   
          partition: "aps_bfx"
          traffic_group: "traffic-group-local-only" #or /Common/traffic-group-local-only   
          state: "present"               

I always get :

...
"400 Unexpected Error: Bad Request for uri: https://xxx.xxx.xxx.xxx:443/mgmt/tm/net/self/\nText: u'{\"code\":400,\"message\":\"01070734:3: Configuration error: Traffic group (/aps_bfx/traffic-group-local-only) does not exist.\"

or

{"failed": true, "msg": "The specified traffic group was not found", "self_ip": {"ip_address": "...", "name": "...", "netmask": "...", "traffic_group": "/Common/traffic-group-local-only", "vlan_tunnel": "..."}}

R

bigip_virtual_server should check assignment of pool parameter

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server.py, line: 594

ANSIBLE VERSION
# ansible --version
ansible 2.3.0 (devel 0a86ddc251) last updated 2016/10/05 11:22:39 (GMT +200)
PYTHON VERSION
# python -V
Python 2.7.6
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     11.6.0
  Build       6.0.442
  Edition     Hotfix HF6
  Date        Tue Oct 27 16:12:46 PDT 2015
CONFIGURATION

standard, no changes

OS / ENVIRONMENT

Ubuntu 14.04 LTS

SUMMARY

When creating virtual server from role which contains loop, you don't need pool to be assigned every time

STEPS TO REPRODUCE
- name: create virtual servers
  tags: f5_create_vservers
  bigip_virtual_server:
    validate_certs: False
    server: "ip"
    user: "user"
    password: "pass"
    partition: "partition"
    state: present
    name: "{{ item.lname }}"
    destination: "{{ item.lip }}"
    port: "{{ item.lport }}"
    pool: "{{ item.lpool }}"
    snat: Automap
  delegate_to: localhost
  with_items:
    - { lname: 'VS_HTTP1', lpool: , lip: '1.2.3.4', lport: '80'}
    - { lname: 'VS_HTTP2', lpool: 'test_pool', lip: '1.2.3.5', lport: '80'}
EXPECTED RESULTS

I expect to see both VS created within the same role, one with default pool assignment, another without default pool assigment.

ACTUAL RESULTS
failed: [localhost -> localhost] (item={u'lname': u'VS_HTTP1', u'lport': u'80', u'lpool': None, u'lip': u'1.2.3.4'}) => {
    "failed": true,
    "invocation": {
        "module_args": {
            "all_profiles": [
                "http",
                "clientssl"
            ],
            "all_rules": null,
            "default_persistence_profile": null,
            "description": null,
            "destination": "1.2.3.4",
            "enabled_vlans": null,
            "name": "VS_HTTP1",
            "partition": "partition",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "",
            "port": 80,
            "route_advertisement_state": "disabled",
            "server": "f5_ip",
            "server_port": 443,
            "snat": "Automap",
            "state": "present",
            "user": "admin",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    },
    "item": {
        "lip": "1.2.3.4",
        "lname": "VS_HTTP1",
        "lpool": null,
        "lport": "80"
    },
    "msg": "received exception: Error on creating Virtual Server : Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/VirtualServer::create()\nException: Common::OperationFailed\n\tprimary_error_code   : 16908342 (0x01020036)\n\tsecondary_error_code : 0\n\terror_string         : 01020036:3: The requested pool (/partition) was not found.'"
}
POSSIBLE FIX

Replace line 594 in bigip_virtual_server.py with following:

    if module.params['pool'] is not '':
        pool = fq_name(partition, module.params['pool'])
    else:
        pool = ''

And this works just fine.

bigip_virtual_server cannot assign an SNAT pool

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
Ansible 2.2.0
PYTHON VERSION
Python 2.7.6
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       1.0.196
  Edition     Hotfix HF1
  Date        Wed Sep  7 17:48:09 PDT 2016

CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

New feature request to be able to configure SNAT pool with the bigip_virtual_server modules. Not expecting to be able to produce the SNAT pool just to reference it.

STEPS TO REPRODUCE

Expected to be used as follows

- name: Add virtual server with SNAT Pool
  bigip_virtual_server:
      <extra non relevant config removed>
      snat: Pool
      snatpool: MySNATPool

EXPECTED RESULTS

A virtual server to be created using an snatpool MySNATPool like the following tmsh
create ltm virtual MyVirtualServer source-address-translation { pool MySNATPool type snat }

ACTUAL RESULTS

bigip_virtual_server issue

Hi - I have a quick question. I'm working with this module and am attempting to create a VS according to the documentation provided on Ansible's website. Currently the module is failing to build the VS as specified on my F5 in the lab. The message I am receiving is msg: received exception urlopen error [Errno -5] No address associated with hostname. I'm using Ansible v2.2.0 last updated this morning at 09:28 which is running on Fedora 23. I'm using an IP address to access my device so there should be no issue with DNS resolution. My F5 in the lab is running v11.5.4. Please let me know if I can provide any other information to assist with this. Thanks!

bigip_node.yml error

bigip_node.yml will result in an error .

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_LUv4Q7/ansible_module_bigip_node.py", line 398, in <module>
    main()
  File "/tmp/ansible_LUv4Q7/ansible_module_bigip_node.py", line 295, in main
    (server, user, password, state, partition, validate_certs) = f5_parse_arguments(module)
ValueError: too many values to unpack

fatal: [bigip1 -> 127.0.0.1]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "bigip_node"}, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_LUv4Q7/ansible_module_bigip_node.py\", line 398, in <module>\n    main()\n  File \"/tmp/ansible_LUv4Q7/ansible_module_bigip_node.py\", line 295, in main\n    (server, user, password, state, partition, validate_certs) = f5_parse_arguments(module)\nValueError: too many values to unpack\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

Change before

    (server, user, password, state, partition, validate_certs ) = f5_parse_arguments(module)

After the change

    (server, user, password, state, partition, validate_certs, server_port) = f5_parse_arguments(module)

After the correction , now OK.

feature request routeing

Hi

I missing a module to add static route /default route both in Common but preferred in Partition/RD.
Then I can convert from bigsuds to ansible for base deployments.

Regards
Christer

bigip_partition

Hi

It feels like the bigip_partition.py is a copy if bigip_sysdb.py but not ready.

ansible-doc -M bigip_partition talk about sysdb.

Regards
Christer

bigip_virtual_server fails on subsequent runs based on sort order of iRule list

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

The sort order of irules in the bigip_virtual_server module can cause the task to fail if the first rule in the list has a lower alphanumeric sort order than the rules that follow it.

NOTE: this only happens on subsequent runs; the virtual server is always successfully created on first run.

The error message received:

received exception: Error on updating Virtual Server : Server raised fault: 'Exception caught in System::urn:iControl:System/Session::submit_transaction()
Exception: Common::OperationFailed
    primary_error_code   : 16908390 (0x01020066)
    secondary_error_code : 0
    error_string         : 01020066:3: The requested virtual server rule (/Common/myvip /Common/myirule) already exists in partition Common.'
STEPS TO REPRODUCE

Create three iRules named zrule, myrule, and myrule2. I used the following TCL code in my tests:

when HTTP_REQUEST {
    HTTP::respond 200 content "OK"
}

Create a task that uses the bigip_virtual_server module with the following configuration parameters:

- name: Add virtual server
bigip_virtual_server:
  state: present
  name: myvip
  destination: "1.1.1.1"
  port: 80
  pool: mypool
  snat: Automap
  all_profiles:
    - http
    - tcp
  all_rules:
    - myirule
    - myirule2
  password: "{{ bigip_password }}"
  server: "{{ inventory_hostname }}"
  user: "{{ bigip_username }}"
  validate_certs: "{{ validate_certs }}"

Run this task once to create the virtual server, and then a second time to verify that there are no errors.

Change the all_rules option to include the zrule iRule at the top of the list:

all_rules:
  - zrule
  - myrule
  - myrule2

Run the task again, at which point it will fail.

If you remove the zrule iRule, the task will once again run successfully. The task will also run successfully if you put the zrule iRule at the end of the list.

EXPECTED RESULTS

The sort order of iRules should not cause the bigip_virtual_server module to fail.

ACTUAL RESULTS

The iRule is successfully created, but fails on every run after that:

Successful Creation
Using module file /playbooks/library/bigip_virtual_server.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
ok: [lbl11.example.com] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "all_profiles": [
                "http",
                "tcp"
            ],
            "all_rules": [
                "myirule",
                "myirule2"
            ],
            "default_persistence_profile": null,
            "description": null,
            "destination": "1.1.1.1",
            "enabled_vlans": null,
            "name": "myvip",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "mypool",
            "port": 80,
            "route_advertisement_state": "disabled",
            "server": "lbl11.example.com",
            "server_port": 443,
            "snat": "Automap",
            "state": "present",
            "user": "ansible",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    }
}

PLAY RECAP *********************************************************************
lbl11.example.com     : ok=2    changed=0    unreachable=0    failed=0
Second Run that fails:
Using module file /playbooks/library/bigip_virtual_server.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
fatal: [lbl11.example.com]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "all_profiles": [
                "http",
                "tcp"
            ],
            "all_rules": [
                "zrule",
                "myirule",
                "myirule2"
            ],
            "default_persistence_profile": null,
            "description": null,
            "destination": "1.1.1.1",
            "enabled_vlans": null,
            "name": "myvip",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "mypool",
            "port": 80,
            "route_advertisement_state": "disabled",
            "server": "lbl11.example.com",
            "server_port": 443,
            "snat": "Automap",
            "state": "present",
            "user": "ansible",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    },
    "msg": "received exception: Error on updating Virtual Server : Server raised fault: 'Exception caught in System::urn:iControl:System/Session::submit_transaction()\nException: Common::OperationFailed\n\tprimary_error_code   : 16908390 (0x01020066)\n\tsecondary_error_code : 0\n\terror_string         : 01020066:3: The requested virtual server rule (/Common/myvip /Common/myirule) already exists in partition Common.'"
}
        to retry, use: --limit @/playbooks/bigip_testing.retry

PLAY RECAP *********************************************************************
lbl11.example.com     : ok=1    changed=0    unreachable=0    failed=1

Policy Modification/Creation not supported

Local Traffic Policies cannot be managed via Ansible

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Local traffic Policies

ANSIBLE VERSION
ansible 2.1.0
PYTHON VERSION
python 2.7.5
BIGIP VERSION
12.1.0
CONFIGURATION

tmsh create ltm policy Drafts/Policy strategy first-match rules replace-all-with { homepage { actions add { 0 { forward select pool pool1 } } conditions add { 0 { http-uri path contains values { /HomePage } } } ordinal 0 } second { actions add { 0 { forward select pool pool2 } } conditions add { 0 { http-uri path contains values { /second } } } ordinal 1 } ....... }

OS / ENVIRONMENT

RHEL 7

SUMMARY

need to be able to manage policies and add to them without resorting to tmsh, or command
the following functionality would be needed:

  1. Create a draft policy -

    create ltm policy Drafts/foo <...>

NOTE: this creates a policy - /Common/Drafts/foo (if you were to do this in a different folder, the Drafts will hang off that, for example - /Common/bar/Drafts/foo)

  1. Publish the above -

    publish ltm policy Drafts/foo

    NOTE: This step will delete the foo from Drafts folder and create a new policy foo (for example, /Common/Drafts/foo will be renamed/moved to /Common/foo)

  2. To modify the policy, 3 steps are needed -

    modify ltm policy foo create-draft

      - will create draft; so there will now be 2 foo's - /Common/foo and /Common/Drafts/foo
    

    modify ltm policy Drafts/foo <...>

      - will only affect the draft copy
    

    publish ltm policy Drafts/foo

      - will replace /Common/foo with /Common/Drafts/foo
    
  3. assign to a vserver (#39)

Traffic Group support within bigip_virtual_address.py

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

bigip_virtual_address

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/library/', '/usr/share/ansible/']

PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       1.0.196
  Edition     Hotfix HF1
  Date        Wed Sep  7 17:48:09 PDT 2016

Hotfix List
ID321971-1    ID585366    ID614599    ID596814-5  ID601938-2  ID595394-2
ID593355      ID590608-1  ID585120-1  ID600859-3  ID603997    ID527403-1
ID589149-2    ID575170-2  ID599068-2  ID608373-2  ID589318-1  ID599769
ID594910-1    ID598294-1  ID599033-3  ID599054-2  ID600778-1  ID603605-1
ID513851-2    ID590074-1  ID605682-2  ID604211-3  ID601927-1  ID595064-1
ID606509-3    ID590578-4  ID606110-3

CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

It would be helpful if the bigip_virtual_address module supported managing the traffic-group associated with it. It should be very similar to how it is used in the bigip_selfip module.

STEPS TO REPRODUCE
- name: Change Traffic-group on virtual address
  bigip_virtual_address:
      server: lb.mydomain.net
      user: admin
      password: secret
      state: present
      partition: Common
      address: 10.10.10.10
      traffic_group: "/Common/traffic-group-2"
  delegate_to: localhost
EXPECTED RESULTS

Traffic group will be updated if necessary

ACTUAL RESULTS

param not yet supported


bigip_vlan fails to create tagged interfaces as per documentation

ISSUE TYPE
  • Bug Report
COMPONENT NAME

F5 bigip (bigip_vlan)

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

When attempting to create or modify a VLAN to add a tagged interface, the VLAN ID/tag is assigned to the VLAN, but the interface is always added as an untagged interface.

STEPS TO REPRODUCE

Create a task that uses the bigip_vlan module that includes a tag and interfaces parameter as described in the module documentation.

- name: Add tagged interface to internal vlan
  bigip_vlan:
    interfaces:
      - 1.1
    name: "internal"
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    tag: "1024"
    user: "{{ bigip_username }}"
    validate_certs: "{{ validate_certs }}"
EXPECTED RESULTS

It should properly configure the vlan with the interface's tagged property set.

Example tmsh configuration with properly tagged interface created from the web admin GUI:

(tmos)# list /net vlan internal 
net vlan internal {
    if-index 192
    interfaces {
        1.1 {
            tagged
        }
    }
    tag 50
}
ACTUAL RESULTS

The VLAN is created with the correct tag, but the interface is missing the tagged property.

Example tmsh configuration generated by bigip_vlan:

(tmos)# list /net vlan internal 
net vlan internal {
    if-index 192
    interfaces {
        1.1 { }
    }
    tag 50
}

bigip_ssl_certificate not uploading complete filename

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_ssl_certificate

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product  BIG-IP
  Version  11.5.2
  Build    0.0.141
  Edition  Final
  Date     Fri Jan 30 14:50:39 PST 2015
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

When specifying cert_content, key_content, cert_src, or key_src the files on the F5 are not getting the .key or .crt appended to the certificate name. This is resulting in duplicate certs on the F5 from a GUI standpoint and either one cannot be deleted.

STEPS TO REPRODUCE
---
- name: Prepare F5 for SSL Certificate Upload
  hosts: ltm
  remote_user: ansible
  gather_facts: false

  vars_files:
    - vars/secrets.yml

  tasks:
    # This is needed or the upload fails
    - name: ensure download directory exists
      raw: "mkdir -p /var/config/rest/downloads/tmp/"


- name: Upload SSL Certificates to LTMs
  hosts: ltm
  remote_user: root
  gather_facts: false

  vars_files:
    - vars/secrets.yml

  tasks:
    - name: Import PEM Certificate
      bigip_ssl_certificate:
        name: "wildcard_ftscc_net"
        server: "{{ ansible_host }}"
        user: "{{ f5_user }}"
        password: "{{ f5_password }}"
        state: "present"
        validate_certs: false
        cert_content: "{{ cert content goes here }}"
        key_content: "{{ key content goes here }}"
      delegate_to: "{{ jump_server }}"
ansible-playbook -i inventory/hosts -e "cert_file=wildcard_ftscc_net.yml" --vault-password-file ~/.vault_password import_ssl_cert.yml
EXPECTED RESULTS

The existing key that was uploaded via GUI was overwritten with new version.

ACTUAL RESULTS

A duplicate key was installed without the file extension resulting in 2 of the same SSL certs visible through the GUI. The certificates below with the 49524 extension was uploaded through the GUI and is the old version. The 75278 extension was done through Ansible. The Ansible version should have overwritten the existing version.

[ root@f5 /config/filestore/files_d/Common_d]# find . -name "*ftscc*"
./certificate_key_d/:Common:wildcard_ftscc_net_75278_1
./certificate_key_d/:Common:wildcard_ftscc_net.key_49524_2
./certificate_d/:Common:wildcard_ftscc_net_75276_1
./certificate_d/:Common:wildcard_ftscc_net.crt_49528_2

bigip_license not able to license a new ve ltm

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_license

ANSIBLE VERSION
ansible 2.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

undefined global variable issue when attempting to license an unlicensed bigip ltm.

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 685, in <module>
    main()
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 651, in main
    if obj.present():
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 586, in present
    if not lic_server and lic_status == 'STATE_DISABLED':
NameError: global name 'lic_status' is not defined

fatal: [hostname.here]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_license"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 685, in <module>\n    main()\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 651, in main\n    if obj.present():\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 586, in present\n    if not lic_server and lic_status == 'STATE_DISABLED':\nNameError: global name 'lic_status' is not defined\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE"
}
STEPS TO REPRODUCE
  - name: Set LTM license
      bigip_license:
        password: "{{ bigip_password }}"
        server: "{{ inventory_hostname }}"
        key: "{{ ltm_license }}"
        state: "present"
        user: "{{ bigip_username }}"
        validate_certs: "{{ validate_certs }}"
EXPECTED RESULTS

I expected it to license the bigip

ACTUAL RESULTS
TASK [Set LTM license] *********************************************************
task path: /playbooks/bigip_license.yaml:4
Using module file /playbooks/library/bigip_license.py
<hostname.here> ESTABLISH LOCAL CONNECTION FOR USER: root
<hostname.here> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 685, in <module>
    main()
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 651, in main
    if obj.present():
  File "/tmp/ansible_W7EbhA/ansible_module_bigip_license.py", line 586, in present
    if not lic_server and lic_status == 'STATE_DISABLED':
NameError: global name 'lic_status' is not defined

fatal: [hostname.here]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_name": "bigip_license"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 685, in <module>\n    main()\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 651, in main\n    if obj.present():\n  File \"/tmp/ansible_W7EbhA/ansible_module_bigip_license.py\", line 586, in present\n    if not lic_server and lic_status == 'STATE_DISABLED':\nNameError: global name 'lic_status' is not defined\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE"
}
	to retry, use: --limit @/playbooks/bigip_network_bootstrap.retry

PLAY RECAP *********************************************************************
hostname.here    : ok=9    changed=1    unreachable=0    failed=1

Add Fallback Persistence to BigIP_Virtual

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ltm BigIP virtual server

ANSIBLE VERSION
2.2
PYTHON VERSION
2.7.5
BIGIP VERSION
12.1.0
CONFIGURATION
OS / ENVIRONMENT

RHEL 7

SUMMARY

I need to add a fallback persistence profile, there is no tag on the bigip_virtual module to add a fall back persistence method

STEPS TO REPRODUCE
tmsh: 
 modify ltm virtual VIP_NAME fallback-persistence source_addr 
EXPECTED RESULTS
ACTUAL RESULTS
No way to add fall back persistence

bigip_virtual_server module is unable to create vip with fasthttp profile

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
ansible 2.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
PYTHON VERSION
Python 2.7.12
F5 BIGIP LTM VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       0.0.184
  Edition     Final
  Date        Thu Aug 11 17:09:01 PDT 2016
CONFIGURATION
retry_files_enabled = False
host_key_checking=False
OS / ENVIRONMENT

Alpine 3.4 (Docker Container)

SUMMARY

The bigip_virtual_server module is unable to create a virtual server with the profile "fasthttp". The following error is returned:

01070734:3: Configuration error: Found disallowed profile on /Common/myvip: Not Any Of (FastL4 Profile, FastHTTP Profile)
STEPS TO REPRODUCE

Create a task that uses the bigip_virtual_server module with the following configuration parameters:

- name: Create virtual server
  bigip_virtual_server:
    name: "myvip"
    destination: "1.1.1.1"
    port: "80"
    pool: "mypool"
    snat: "Automap"
    description: "Primary VIP"
    all_profiles:
      - fasthttp
    password: "{{ bigip_password }}"
    server: "{{ inventory_hostname }}"
    state: "enabled"
    user: "{{ bigip_username }}"
    validate_certs: "{{ validate_certs }}"
EXPECTED RESULTS

The bigip_virtual_server module should successfully create a virtual server with the profile fasthttp.

The following is an example tmsh configuration of a Performance (HTTP) virtual server created through the GUI:

# tmsh list /ltm virtual
ltm virtual myvip {
    destination 1.1.1.1:http
    ip-protocol tcp
    mask 255.255.255.255
    pool mypool
    profiles {
        fasthttp { }
    }
    source 0.0.0.0/0
    translate-address enabled
    translate-port enabled
    vs-index 10
}
ACTUAL RESULTS

The following error occurs when the playbook task is run:

Using module file /playbooks/library/bigip_virtual_server.py
<lbl11.example.com> ESTABLISH LOCAL CONNECTION FOR USER: root
<lbl11.example.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252 `" && echo ansible-tmp-1475100826.05-161604525418252="` echo $HOME/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252 `" ) && sleep 0'
<lbl11.example.com> PUT /tmp/tmpx4q3V8 TO /root/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252/bigip_virtual_server.py
<lbl11.example.com> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252/ /root/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252/bigip_virtual_server.py && sleep 0'
<lbl11.example.com> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252/bigip_virtual_server.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1475100826.05-161604525418252/" > /dev/null 2>&1 && sleep 0'
failed: [lbl11.example.com] (item={u'description': u'Primary VIP', u'rules': None, u'destination': u'1.1.1.1', u'profiles': [u'fasthttp'], u'state': u'enabled', u'snat': u'Automap', u'port': 80, u'pool': u'mypool', u'name': u'myvip'}) => {
    "failed": true,
    "invocation": {
        "module_args": {
            "all_enabled_vlans": null,
            "all_profiles": [
                "fasthttp"
            ],
            "all_rules": [
                ""
            ],
            "default_persistence_profile": null,
            "description": "Primary VIP",
            "destination": "1.1.1.1",
            "name": "myvip",
            "partition": "Common",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": "mypool",
            "port": 80,
            "server": "lbl11.example.com",
            "server_port": 443,
            "snat": "Automap",
            "state": "enabled",
            "user": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "validate_certs": false
        },
        "module_name": "bigip_virtual_server"
    },
    "item": {
        "description": "Primary VIP",
        "destination": "1.1.1.1",
        "name": "myvip",
        "pool": "mypool",
        "port": 80,
        "profiles": [
            "fasthttp"
        ],
        "rules": null,
        "snat": "Automap",
        "state": "enabled"
    },
    "msg": "received exception: Error on setting profiles : Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/VirtualServer::add_profile()\nException: Common::OperationFailed\n\tprimary_error_code   : 17237812 (0x01070734)\n\tsecondary_error_code : 0\n\terror_string         : 01070734:3: Configuration error: Found disallowed profile on /Common/myvip: Not Any Of (FastL4 Profile, FastHTTP Profile)'"
}
        to retry, use: --limit @/playbooks/ltm_application.retry

bigip_virtual_server cannot specifiy all_rules without error: pop from empty list

ISSUE TYPE
  • Bug Report
COMPONENT NAME

bigip_virtual_server

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/library/', '/usr/share/ansible/']

PYTHON VERSION
Python 2.7.5
BIGIP VERSION
Sys::Version
Main Package
  Product     BIG-IP
  Version     12.1.1
  Build       1.0.196
  Edition     Hotfix HF1
  Date        Wed Sep  7 17:48:09 PDT 2016

Hotfix List
ID593355      ID321971-1  ID589318-1  ID604211-3  ID599068-2  ID594910-1
ID585120-1    ID603997    ID513851-2  ID585366    ID589149-2  ID599054-2
ID601938-2    ID608373-2  ID606110-3  ID590074-1  ID575170-2  ID600778-1
ID598294-1    ID595394-2  ID605682-2  ID590608-1  ID596814-5  ID590578-4
ID601927-1    ID595064-1  ID600859-3  ID599033-3  ID527403-1  ID603605-1
ID614599      ID599769    ID606509-3
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

I cannot get it to not produce the error when specifying irules ("all_rules")

STEPS TO REPRODUCE
root@localhost playbooks]# ansible-playbook -i hosts test4.yaml

[root@localhost playbooks]# cat test4.yaml
---
# Update the F5 DMZ Device Group
- name: Update F5 DMZ Device Group
  hosts:
     - F5DMZ
  connection: local

  tasks:
      - name: Add update virtual server rules
        bigip_virtual_server:
            server: "10.201.97.33"
            user: "admin"
            password: "ommited"
            name: "testVS"
            partition: "GEN"
            state: "present"
            all_rules:
               - /Common/_sys_https_redirect
               - /Common/_sys_auth_tacacs


EXPECTED RESULTS

OK

ACTUAL RESULTS

TASK [Add update virtual server rules] *****************************************
task path: /root/playbooks/test4.yaml:9
Using module file /root/library/bigip_virtual_server.py
<10.201.97.33> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.201.97.33> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053 `" && echo ansible-tmp-1482455135.45-62810326986053="` echo $HOME/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053 `" ) && sleep 0'
<10.201.97.33> PUT /tmp/tmppin4ZK TO /root/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053/bigip_virtual_server.py
<10.201.97.33> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053/ /root/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053/bigip_virtual_server.py && sleep 0'
<10.201.97.33> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053/bigip_virtual_server.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1482455135.45-62810326986053/" > /dev/null 2>&1 && sleep 0'
fatal: [10.201.97.33]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "all_profiles": null,
            "all_rules": [
                "/Common/_sys_https_redirect",
                "/Common/_sys_auth_tacacs"
            ],
            "default_persistence_profile": null,
            "description": null,
            "destination": null,
            "enabled_vlans": null,
            "fallback_persistence_profile": null,
            "name": "testVS",
            "partition": "GEN",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": null,
            "port": null,
            "route_advertisement_state": "disabled",
            "server": "10.201.97.33",
            "server_port": 443,
            "snat": null,
            "state": "present",
            "user": "admin",
            "validate_certs": true
        },
        "module_name": "bigip_virtual_server"
    },
    "msg": "received exception: Error on updating Virtual Server : pop from empty list"
}
        to retry, use: --limit @/root/playbooks/test4.retry

PLAY RECAP *********************************************************************
10.201.97.33               : ok=1    changed=0    unreachable=0    failed=1


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.