{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/14183","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/14183/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/14183/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/14183/events","html_url":"https://github.com/saltstack/salt/issues/14183","id":37757737,"number":14183,"title":"service does not restart after watched config","user":{"login":"kevich","id":2560726,"avatar_url":"https://avatars1.githubusercontent.com/u/2560726?v=4","gravatar_id":"","url":"https://api.github.com/users/kevich","html_url":"https://github.com/kevich","followers_url":"https://api.github.com/users/kevich/followers","following_url":"https://api.github.com/users/kevich/following{/other_user}","gists_url":"https://api.github.com/users/kevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevich/subscriptions","organizations_url":"https://api.github.com/users/kevich/orgs","repos_url":"https://api.github.com/users/kevich/repos","events_url":"https://api.github.com/users/kevich/events{/privacy}","received_events_url":"https://api.github.com/users/kevich/received_events","type":"User","site_admin":false},"labels":[{"id":41387723,"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":41388135,"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143","default":false},{"id":194766284,"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5","default":false},{"id":194768064,"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestone/13","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars0.githubusercontent.com/u/507599?v=4","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2247,"closed_issues":7345,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2018-05-18T01:10:48Z","due_on":null,"closed_at":null},"comments":33,"created_at":"2014-07-14T03:55:52Z","updated_at":"2018-05-18T01:37:37Z","closed_at":null,"author_association":"NONE","body":"os: opensuse \nservice_provider: rh_service \nsalt-call --versions-report \nSalt: 2014.1.5 \nPython: 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] \nJinja2: 2.6 \nM2Crypto: 0.21.1 \nmsgpack-python: 0.2.4 \nmsgpack-pure: Not Installed \npycrypto: 2.3 \nPyYAML: 3.10 \nPyZMQ: 13.0.0 \nZMQ: 3.2.2 \n\nscenario: \n- on opensuse install postgresql-server package, \n- start service so it's generate default configs in /var/lib/pgsql \n- edit pg_hba with file.replace \n- expect service restart, but it just check if postgresql running and returns true \n\nif we edit pg_hba so file.replace runs again then service restarts ok, but not for the first run. I think it's somehow related to postgres_first_run starting service, but can't find anything \nrelevant in the logs \n\n example states from debug output: \n\n```\npostgresql:\n  pkg:\n    - installed\n    - name: postgresql-server\n  service:\n    - running\n    - enable: True\n    - watch:  \n      - file: /var/lib/pgsql/data/pg_hba.conf \n\n/var/lib/pgsql/data/pg_hba.conf: \n  file.replace:\n    - pattern: (^host.*127\\.0\\.0\\.1/32\\s*).*$ \n    - repl: \\1md5 \n    - watch: \n      - pkg: postgresql \n\npostgres_first_run: \n  cmd.wait:\n    - name: /etc/init.d/postgresql start >/dev/null 2>&1; sleep 5; echo -e '\\nchanged=yes\\n' \n    - stateful: True \n    - watch: \n      - pkg: postgresql \n    - watch_in: \n      - file: /var/lib/pgsql/data/pg_hba.conf \n```\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/390067691","html_url":"https://github.com/saltstack/salt/issues/14183#issuecomment-390067691","issue_url":"https://api.github.com/repos/saltstack/salt/issues/14183","id":390067691,"user":{"login":"rsyring","id":109467,"avatar_url":"https://avatars0.githubusercontent.com/u/109467?v=4","gravatar_id":"","url":"https://api.github.com/users/rsyring","html_url":"https://github.com/rsyring","followers_url":"https://api.github.com/users/rsyring/followers","following_url":"https://api.github.com/users/rsyring/following{/other_user}","gists_url":"https://api.github.com/users/rsyring/gists{/gist_id}","starred_url":"https://api.github.com/users/rsyring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsyring/subscriptions","organizations_url":"https://api.github.com/users/rsyring/orgs","repos_url":"https://api.github.com/users/rsyring/repos","events_url":"https://api.github.com/users/rsyring/events{/privacy}","received_events_url":"https://api.github.com/users/rsyring/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T01:37:37Z","updated_at":"2018-05-18T01:37:37Z","author_association":"CONTRIBUTOR","body":"I have a simple example:\r\n```yaml\r\n# openvpn/server.sls\r\nopenvpn-server:\r\n  pkg.installed:\r\n    - name: openvpn\r\n  service.running:\r\n    - name: openvpn\r\n    - enable: True\r\n\r\nopenvpn-server-config:\r\n  file.managed:\r\n    - name: /etc/openvpn/server.conf\r\n    - source: salt://openvpn/server.conf\r\n    - template: jinja\r\n    - user: root\r\n    - watch_in:\r\n      - service: openvpn\r\n```\r\n\r\nApplication of said state follows.  Note that the server.conf file is put in place for the first time but the service does not restart.\r\n\r\n```\r\nsalt tang-master state.apply openvpn.server\r\ntang-master:\r\n----------\r\n          ID: openvpn-server\r\n    Function: pkg.installed\r\n        Name: openvpn\r\n      Result: True\r\n     Comment: All specified packages are already installed\r\n     Started: 01:26:36.644242\r\n    Duration: 22.522 ms\r\n     Changes:   \r\n----------\r\n          ID: openvpn-server-config\r\n    Function: file.managed\r\n        Name: /etc/openvpn/server.conf\r\n      Result: True\r\n     Comment: File /etc/openvpn/server.conf updated\r\n     Started: 01:26:36.669657\r\n    Duration: 34.687 ms\r\n     Changes:   \r\n              ----------\r\n              diff:\r\n                  New file\r\n              mode:\r\n                  0644\r\n----------\r\n          ID: openvpn-server\r\n    Function: service.running\r\n        Name: openvpn\r\n      Result: True\r\n     Comment: Service openvpn is already enabled, and is running\r\n     Started: 01:26:36.704622\r\n    Duration: 68.776 ms\r\n     Changes:   \r\n              ----------\r\n              openvpn:\r\n                  True\r\n\r\nSummary for tang-master\r\n------------\r\nSucceeded: 3 (changed=2)\r\nFailed:    0\r\n------------\r\nTotal states run:     3\r\nTotal run time: 125.985 ms\r\n```\r\n\r\nVersions:\r\n```\r\nroot@tang-master:/# salt-minion --versions\r\nSalt Version:\r\n           Salt: 2018.3.0\r\n \r\nDependency Versions:\r\n           cffi: Not Installed\r\n       cherrypy: Not Installed\r\n       dateutil: 2.4.2\r\n      docker-py: Not Installed\r\n          gitdb: 0.6.4\r\n      gitpython: 1.0.1\r\n          ioflo: Not Installed\r\n         Jinja2: 2.8\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n       M2Crypto: Not Installed\r\n           Mako: 1.0.3\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.4.6\r\n   mysql-python: Not Installed\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n   pycryptodome: Not Installed\r\n         pygit2: Not Installed\r\n         Python: 2.7.12 (default, Dec  4 2017, 14:50:18)\r\n   python-gnupg: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 15.2.0\r\n           RAET: Not Installed\r\n          smmap: 0.9.0\r\n        timelib: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.1.4\r\n \r\nSystem Versions:\r\n           dist: Ubuntu 16.04 xenial\r\n         locale: ANSI_X3.4-1968\r\n        machine: x86_64\r\n        release: 4.13.0-41-generic\r\n         system: Linux\r\n        version: Ubuntu 16.04 xenial\r\n```"}}
{"actor":{"display_login":"rsyring"}}