{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/19413","labels_url":"https://api.github.com/repos/saltstack/salt/issues/19413/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/19413/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/19413/events","html_url":"https://github.com/saltstack/salt/issues/19413","id":53571036,"number":19413,"title":"feature request for network.managed","user":{"login":"gzcwnk","id":8229394,"avatar_url":"https://avatars.githubusercontent.com/u/8229394?v=3","gravatar_id":"","url":"https://api.github.com/users/gzcwnk","html_url":"https://github.com/gzcwnk","followers_url":"https://api.github.com/users/gzcwnk/followers","following_url":"https://api.github.com/users/gzcwnk/following{/other_user}","gists_url":"https://api.github.com/users/gzcwnk/gists{/gist_id}","starred_url":"https://api.github.com/users/gzcwnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzcwnk/subscriptions","organizations_url":"https://api.github.com/users/gzcwnk/orgs","repos_url":"https://api.github.com/users/gzcwnk/repos","events_url":"https://api.github.com/users/gzcwnk/events{/privacy}","received_events_url":"https://api.github.com/users/gzcwnk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-06T22:19:08Z","updated_at":"2015-01-07T19:54:18Z","closed_at":null,"body":"So if I run,\r\n\r\n```\r\neth0:\r\n  network.managed:\r\n    - enabled: True\r\n    - type: eth\r\n    - dns:\r\n      - 8.8.8.8\r\n      - 8.8.4.4\r\n```\r\n\r\nglobally it replaces ifcfg-eth0 with the above content and buggers (technical term) the server(s) as it removes all other lines.\r\n\r\nWhat I need to do is change the DNS1=xxxx and DNS2=yyyyy  only and nothing else.\r\n\r\nso add something like \r\n\r\n- modify:\r\n\r\nand maybe\r\n\r\n- remove:\r\n\r\nand\r\n\r\n- add:\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/69081112","html_url":"https://github.com/saltstack/salt/issues/19413#issuecomment-69081112","issue_url":"https://api.github.com/repos/saltstack/salt/issues/19413","id":69081112,"user":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T19:54:18Z","updated_at":"2015-01-07T19:54:18Z","body":"So it just removes the extra lines from the `eth0` config, not from other interfaces, correct?\r\n\r\nThis is to be expected. The state manages the whole interface. The idea behind states is to describe the state of some piece of a server. So if you manage an interface with the state, then it removes things you haven't specified -- otherwise if you wanted to make sure some arguments weren't present, you'd have to explicitly have some sort of `network.arg_absent` state or something.\r\n\r\nI think what you're trying to do should be handled in a remote execution module. Adding, removing, and modifying are not stateful operations. They're iterative. It's like the difference between the `file.append` execution module function and the `file.managed` state module -- the first is iterative, and the second is stateful.\r\n\r\nAnyway, now that I'm done rambling, I don't see a problem with adding execution module functions to accomplish tasks like this. So I'll mark this as approved. =)"}}