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

Delete artifacts of interfaces not managed any more #72

Open
murinicanor opened this issue Oct 18, 2017 · 1 comment
Open

Delete artifacts of interfaces not managed any more #72

murinicanor opened this issue Oct 18, 2017 · 1 comment

Comments

@murinicanor
Copy link

if i create a bridge using debops.ifupdown

        ifupdown__interfaces: {                                                                                                              
          'foobar': {
            type: bridge,
            inet: 'static',
            address: '10.2.2.2/25' }
          }

and later remove that bridge, the interface-file does not get removed from /etc/network/interfaces.config.d (and /etc/network/interfaces.d). maybe the directory should be purged before interface-files are being created

@drybjed
Copy link
Member

drybjed commented Oct 18, 2017

The debops.ifupdown role is designed to be used as a dependency by other Ansible/DebOps roles. It means, that there might be configuration in the /etc/network/interfaces.d/ directory which is not entirely known by the role at any given moment, and that's why the role does not clear these directories on each run.

If you want to remove an interface from a host correctly, you first need to mark it for removal by Ansible. Don't remove it from inventory, but add state: "absent" key to its configuration; that way Ansible will know that it should remove the interface on the next run. If you remove the configuration of a given interface from the inventory, Ansible doesn't know about that interface at all, and doesn't touch it.

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

2 participants