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

vyos_facts gather_subset does not update on second run in playbook. #320

Open
arcreigh opened this issue Apr 27, 2023 · 0 comments
Open

Comments

@arcreigh
Copy link

SUMMARY

on initial gather_subset: all variables are populated as expected.
However after a config change is made and gather_subset is ran again to update the variables the old values persist.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vyos.vyos.vyos_facts

ANSIBLE VERSION
ansible [core 2.14.5]
  config file = None
  configured module search path = ['/home/arcreigh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/arcreigh/dev/ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /home/arcreigh/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/arcreigh/dev/ansible/bin/ansible
  python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (/home/arcreigh/dev/ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /home/arcreigh/dev/ansible/lib/python3.10/site-packages/ansible_collections
Collection Version
---------- -------
vyos.vyos  4.0.2
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

WSL Ubuntu 22.04
vyos 1.3.2

STEPS TO REPRODUCE

Run the below playbook against a vyos device.

---

- name: Network Getting Started First Playbook Extended
  connection: ansible.netcommon.network_cli
  gather_facts: false
  hosts: all
  tasks:

    - name: Get config for VyOS devices
      vyos.vyos.vyos_facts:
        gather_subset: all

    - name: Display the config
      ansible.builtin.debug:
        msg: "The hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}"

    - name: Update the hostname
      vyos.vyos.vyos_hostname:
        config:
          hostname: vyos-updated

    - name: Get changed config for VyOS devices
      vyos.vyos.vyos_facts:
        gather_subset: config

    - name: Display the changed config
      ansible.builtin.debug:
        msg: "The new hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}"
EXPECTED RESULTS

Play name "Display the changed config" Should show the updated hostname from "Update the hostname"

ACTUAL RESULTS
PLAY [Network Getting Started First Playbook Extended] ********************************************************************************************************************

TASK [Get config for VyOS devices] ****************************************************************************************************************************************
ok: [10.25.3.51]

TASK [Display the config] *************************************************************************************************************************************************
ok: [10.25.3.51] => {
    "msg": "The hostname is vyos and the OS is VyOS 1.3.2"
}

TASK [Update the hostname] ************************************************************************************************************************************************
changed: [10.25.3.51]

TASK [Get changed config for VyOS devices] ********************************************************************************************************************************
ok: [10.25.3.51]

TASK [Display the changed config] *****************************************************************************************************************************************
ok: [10.25.3.51] => {
    "msg": "The new hostname is vyos and the OS is VyOS 1.3.2"
}

PLAY RECAP ****************************************************************************************************************************************************************
10.25.3.51                 : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant