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

not idempotent #689

Open
emyr666 opened this issue Apr 22, 2024 · 4 comments
Open

not idempotent #689

emyr666 opened this issue Apr 22, 2024 · 4 comments

Comments

@emyr666
Copy link

emyr666 commented Apr 22, 2024

It keeps saying...

TASK [network : Configure networking connection profiles] **********************
changed: [hostname]

...every time I run the playbook but nothing has changed.

This is the network role section. The template vars come from the host_vars files for each host.

    - role: network
      network_connections:
      - name: ens18
        type: ethernet
        autoconnect: true
        mac: "{{ pxe_mac }}"
        ip:
          dhcp4: true
      - name: ens19
        type: ethernet
        autoconnect: true
        mac: "{{ fast_mac }}"
        ip:
          dhcp4: false
          dhcp4: false
          gateway4: 10.21.0.253
          address:
          - "{{ fast_ip }}/16"
      - persistent_state: absent
@emyr666
Copy link
Author

emyr666 commented Apr 22, 2024

Also, If I change the fast_ip variable and re run it I now get a routing table that looks like this...

[root@hostname]# ip route
default via 10.21.0.253 dev ens19 proto static metric 102
10.21.0.0/16 dev ens19 proto kernel scope link src 10.21.101.101 metric 102
10.21.0.0/16 dev ens19 proto kernel scope link src 10.21.100.1 metric 102
10.23.0.0/16 dev eth0 proto kernel scope link src 10.23.2.42 metric 101
127.0.0.0/8 dev lo proto kernel scope link src 127.0.0.1 metric 30

I.e the old ip still persists - the connection seems to have 2 ips yet the connection description says it should only have 1

@spetrosi
Copy link
Collaborator

Hi, thank you for reporting this. Please provide some info about your set up. What platforms you use as a control and managed Ansible nodes? From where do you run the role? Are you using the latest version?

@emyr666
Copy link
Author

emyr666 commented May 2, 2024

hi, am using the latest version of this role. i use python3.10.8 with ansible installed via pip. The problem in my 2nd post was due to an oversight on my part. However the initial problem is still occurring. I.e. multiple invocations of ansible with this role when nothing changes always marks a change but this should not happen. It still shows

TASK [network : Configure networking connection profiles] **********************
changed: [hostname]

All the other subtasks of this role are fine and show no change. "network : Configure networking connection profiles" is the only one that constistently keeps logging a change in the absence of any change.

@richm
Copy link
Contributor

richm commented Jun 28, 2024

@liangwen12year ^^^

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

No branches or pull requests

3 participants