{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/228","repository_url":"https://api.github.com/repos/saltstack-formulas/postgres-formula","labels_url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/228/comments","events_url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/228/events","html_url":"https://github.com/saltstack-formulas/postgres-formula/pull/228","id":333017458,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MzUwNTE2","number":228,"title":"Allow conf/data directory separation","user":{"login":"noelmcloughlin","id":13322818,"node_id":"MDQ6VXNlcjEzMzIyODE4","avatar_url":"https://avatars1.githubusercontent.com/u/13322818?v=4","gravatar_id":"","url":"https://api.github.com/users/noelmcloughlin","html_url":"https://github.com/noelmcloughlin","followers_url":"https://api.github.com/users/noelmcloughlin/followers","following_url":"https://api.github.com/users/noelmcloughlin/following{/other_user}","gists_url":"https://api.github.com/users/noelmcloughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/noelmcloughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noelmcloughlin/subscriptions","organizations_url":"https://api.github.com/users/noelmcloughlin/orgs","repos_url":"https://api.github.com/users/noelmcloughlin/repos","events_url":"https://api.github.com/users/noelmcloughlin/events{/privacy}","received_events_url":"https://api.github.com/users/noelmcloughlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-16T21:49:13Z","updated_at":"2018-06-18T22:53:20Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/pulls/228","html_url":"https://github.com/saltstack-formulas/postgres-formula/pull/228","diff_url":"https://github.com/saltstack-formulas/postgres-formula/pull/228.diff","patch_url":"https://github.com/saltstack-formulas/postgres-formula/pull/228.patch"},"body":" **This PR adds PostgreSQL support for different `data_dir` and `conf_dir` directories.**    \r\n\r\nSupersedes  #187 which listed following advantages-\r\n\r\n1. User may want separation of data and configuration.\r\n\r\n2. Ubuntu postgresql-server stores config in `/etc`, and data into `/var`.  The `postgres` state fails horribly if `/etc/postgresql/../postgresql.conf` exists, perhaps after `postgres.dropped` runs. \r\n\r\n3. This is **current situation** where `conf_dir` variable exists but not `data_dir`.\r\n```\r\ncodenamemap.yaml:  conf_dir: /etc/postgresql/{{ version }}/main\r\ndefaults.yaml:  conf_dir: /var/lib/pgsql/data\r\nosmap.yaml:  conf_dir: /var/lib/postgres/data\r\nosmap.yaml:  conf_dir: /var/lib/pgsql/{{ repo.version }}/data\r\nosmap.yaml:  conf_dir: /usr/local/var/postgres\r\n```\r\n\r\n4. `postgres` install always fails after 'dropped' (or remove #182) states, because conf_dir remains.\r\n\r\n5. If `conf_dir` and `data_dir` have same value, `pg_ctl` throws permissions error.\r\n       `pg_ctl[8774]: FATAL:  data directory \"/var/lib/pgsql/data\" has group or world access`\r\n\r\nBackwards Compatibility: Depreciated `postgres.create_cluster.command` pillar is supported.\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/comments/398220261","html_url":"https://github.com/saltstack-formulas/postgres-formula/pull/228#issuecomment-398220261","issue_url":"https://api.github.com/repos/saltstack-formulas/postgres-formula/issues/228","id":398220261,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODIyMDI2MQ==","user":{"login":"noelmcloughlin","id":13322818,"node_id":"MDQ6VXNlcjEzMzIyODE4","avatar_url":"https://avatars1.githubusercontent.com/u/13322818?v=4","gravatar_id":"","url":"https://api.github.com/users/noelmcloughlin","html_url":"https://github.com/noelmcloughlin","followers_url":"https://api.github.com/users/noelmcloughlin/followers","following_url":"https://api.github.com/users/noelmcloughlin/following{/other_user}","gists_url":"https://api.github.com/users/noelmcloughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/noelmcloughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noelmcloughlin/subscriptions","organizations_url":"https://api.github.com/users/noelmcloughlin/orgs","repos_url":"https://api.github.com/users/noelmcloughlin/repos","events_url":"https://api.github.com/users/noelmcloughlin/events{/privacy}","received_events_url":"https://api.github.com/users/noelmcloughlin/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T22:53:20Z","updated_at":"2018-06-18T22:53:20Z","author_association":"MEMBER","body":"One question. If we choose non-standard `data_dir` or `conf_dir` will Apparmor block PG? See https://blogs.oracle.com/jsmyth/apparmor-and-mysql.  I cannot find any documented issue and saw no issue in testing.  Did not test in Docker however."}}
{"actor":{"display_login":"noelmcloughlin"}}