Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add regex for network_os_model #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SD-Miles
Copy link

@SD-Miles SD-Miles commented Feb 7, 2023

SUMMARY

I have just incorporated the workaround suggested by @cjhelmkamp and @jguirlinger in the issue discussion, which adds regex to properly identify the hardware model.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • asa_facts
ADDITIONAL INFORMATION

Before fix (anonymized) -- you'll notice that there's no "ansible_net_model" value:

sdmiles@WORKSTATION:~/ansible_network$ ansible example-asa.test.net -i network_inventory.yml -m cisco.asa.asa_facts
example-asa.test.net | SUCCESS => {
    "ansible_facts": {
        "ansible_net_api": "cliconf",
        "ansible_net_asatype": "ASA",
        "ansible_net_filesystems": [
            "disk0:"
        ],
        "ansible_net_filesystems_info": {
            "disk0:": {}
        },
        "ansible_net_gather_network_resources": [],
        "ansible_net_gather_subset": [
            "default",
            "hardware"
        ],
        "ansible_net_hostname": "example-asa",
        "ansible_net_image": "disk0:/asa917-32-k8.bin",
        "ansible_net_memfree_mb": 1595645,
        "ansible_net_memtotal_mb": 2097152,
        "ansible_net_memused_mb": 501506,
        "ansible_net_python_version": "3.10.6",
        "ansible_net_serialnum": "DHI3201L1R7",
        "ansible_net_system": "asa",
        "ansible_net_version": "9.1(7)32",
        "ansible_network_resources": {}
    },
    "changed": false
}

After fix (anonymized) -- the "ansible_net_model" value is now present:

sdmiles@WORKSTATION:~/ansible_network$ ansible example-asa.test.net -i network_inventory.yml -m cisco.asa.asa_facts
example-asa.test.net | SUCCESS => {
    "ansible_facts": {
        "ansible_net_api": "cliconf",
        "ansible_net_asatype": "ASA",
        "ansible_net_filesystems": [
            "disk0:"
        ],
        "ansible_net_filesystems_info": {
            "disk0:": {}
        },
        "ansible_net_gather_network_resources": [],
        "ansible_net_gather_subset": [
            "hardware",
            "default"
        ],
        "ansible_net_hostname": "example-asa",
        "ansible_net_image": "disk0:/asa917-32-k8.bin",
        "ansible_net_memfree_mb": 1595646,
        "ansible_net_memtotal_mb": 2097152,
        "ansible_net_memused_mb": 501505,
        "ansible_net_model": "ASA5520",
        "ansible_net_python_version": "3.10.6",
        "ansible_net_serialnum": "DHI3201L1R7",
        "ansible_net_system": "asa",
        "ansible_net_version": "9.1(7)32",
        "ansible_network_resources": {}
    },
    "changed": false
}

@softwarefactory-project-zuul
Copy link

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 3m 27s
✔️ build-ansible-collection SUCCESS in 4m 42s
ansible-test-network-integration-asa-python39 FAILURE in 18m 15s (non-voting)
ansible-test-network-integration-asa-python38-stable212 FAILURE in 18m 03s (non-voting)
ansible-test-network-integration-asa-python38-stable214 FAILURE in 18m 17s (non-voting)
ansible-test-network-integration-asa-python38-stable211 FAILURE in 18m 00s (non-voting)
ansible-test-network-integration-asa-python38-stable29 FAILURE in 17m 27s (non-voting)
✔️ ansible-test-network-integration-asa-libssh-python39 SUCCESS in 22m 59s
✔️ ansible-test-network-integration-asa-libssh-python38-stable214 SUCCESS in 23m 44s
✔️ ansible-test-network-integration-asa-libssh-python38-stable212 SUCCESS in 21m 43s
✔️ ansible-test-network-integration-asa-libssh-python38-stable211 SUCCESS in 22m 24s
ansible-test-network-integration-asa-libssh-python38-stable29 FAILURE in 22m 45s (non-voting)
ansible-changelog-fragment FAILURE in 15s
✔️ ansible-test-sanity-docker-devel SUCCESS in 7m 48s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 7m 41s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 9m 56s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 8m 42s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 9m 37s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 56s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 7m 38s
✔️ ansible-test-units-asa-python39 SUCCESS in 5m 16s
✔️ ansible-test-units-asa-python36 SUCCESS in 5m 26s
✔️ ansible-test-units-asa-python37 SUCCESS in 6m 52s
✔️ ansible-tox-linters SUCCESS in 4m 51s

@softwarefactory-project-zuul
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/c22c4a76f83041e1adb1d42251f843c7

✔️ ansible-galaxy-importer SUCCESS in 3m 50s
✔️ build-ansible-collection SUCCESS in 8m 31s
ansible-test-network-integration-asa-python39 FAILURE in 6m 58s (non-voting)
ansible-test-network-integration-asa-python38-stable212 FAILURE in 7m 12s (non-voting)
ansible-test-network-integration-asa-python38-stable214 FAILURE in 7m 17s (non-voting)
ansible-test-network-integration-asa-python38-stable211 FAILURE in 7m 12s (non-voting)
ansible-test-network-integration-asa-python38-stable29 FAILURE in 8m 39s (non-voting)
✔️ ansible-test-network-integration-asa-libssh-python39 SUCCESS in 11m 04s
✔️ ansible-test-network-integration-asa-libssh-python38-stable214 SUCCESS in 12m 07s
✔️ ansible-test-network-integration-asa-libssh-python38-stable212 SUCCESS in 12m 33s
✔️ ansible-test-network-integration-asa-libssh-python38-stable211 SUCCESS in 11m 50s
ansible-test-network-integration-asa-libssh-python38-stable29 FAILURE in 11m 34s (non-voting)
ansible-changelog-fragment FAILURE in 16s
✔️ ansible-test-sanity-docker-devel SUCCESS in 22m 43s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 24s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 11m 20s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 10m 32s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 12m 46s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 8m 37s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 45s
✔️ ansible-test-units-asa-python39 SUCCESS in 6m 09s
✔️ ansible-test-units-asa-python36 SUCCESS in 5m 53s
✔️ ansible-test-units-asa-python37 SUCCESS in 6m 30s
✔️ ansible-tox-linters SUCCESS in 10m 21s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ansible_net_model is not returned in facts
1 participant