Skip to content

Don't set modes with every run #233

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

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

SuperTux88
Copy link
Contributor

  • postgresql-cluster-prepared: dir_mode is set in postgresql-config-dir
  • postgresql-config-dir: file_mode for some files is set to 600, and I think all other files are good with default mode. So don't touch any files, only change dirs.

Otherwise these states are changed back and fort every run:

----------
          ID: postgresql-cluster-prepared
    Function: file.directory
        Name: /var/lib/postgresql/10/main
      Result: True
     Comment: Directory /var/lib/postgresql/10/main updated
     Started: 00:46:33.002033
    Duration: 539.572 ms
     Changes:   
              ----------
              mode:
                  0755
----------
          ID: postgresql-config-dir
    Function: file.directory
        Name: /var/lib/postgresql/10/main
      Result: True
     Comment: Directory /var/lib/postgresql/10/main updated
     Started: 00:46:33.565329
    Duration: 235.267 ms
     Changes:   
              ----------
              mode:
                  0644
----------
          ID: postgresql-config-dir
    Function: file.directory
        Name: /etc/postgresql/10/main
      Result: True
     Comment: Directory /etc/postgresql/10/main updated
     Started: 00:46:33.801441
    Duration: 2.057 ms
     Changes:   
              ----------
              mode:
                  0644
----------
          ID: postgresql-pg_hba
    Function: file.managed
        Name: /etc/postgresql/10/main/pg_hba.conf
      Result: True
     Comment: File /etc/postgresql/10/main/pg_hba.conf updated
     Started: 00:46:33.808804
    Duration: 746.758 ms
     Changes:   
              ----------
              mode:
                  0600
----------
          ID: postgresql-pg_ident
    Function: file.managed
        Name: /etc/postgresql/10/main/pg_ident.conf
      Result: True
     Comment: 
     Started: 00:46:34.556873
    Duration: 1.279 ms
     Changes:   
              ----------
              mode:
                  0600
----------
          ID: postgresql-running
    Function: service.running
        Name: postgresql
      Result: True
     Comment: Service reloaded
     Started: 00:46:34.583204
    Duration: 51.512 ms
     Changes:   
              ----------
              postgresql:
                  True

* `postgresql-cluster-prepared`: `dir_mode` is set in `postgresql-config-dir`
* `postgresql-config-dir`: `file_mode` for some files is set to 600, and I think all other files are good with default mode. So don't touch any files, only change dirs.
@noelmcloughlin
Copy link
Contributor

Thanks for PR. I notice updates from #202 change got lost, could you fix that also please.

@SuperTux88
Copy link
Contributor Author

What exactly got lost? {{ postgres.conf_dir }} is still set to dir_mode: {{ postgres.conf_dir_mode }}, which is 0700 in the defaults.yaml, so postgres shouldn't have a problem to start.

@noelmcloughlin
Copy link
Contributor

You're absolutely right - I incorrectly thought file_mode was included in #202 also.

Copy link
Contributor

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@aboe76 aboe76 merged commit be80f74 into saltstack-formulas:master Jun 25, 2018
@aboe76
Copy link
Contributor

aboe76 commented Jun 25, 2018

@SuperTux88 thanks for the fix, @noelmcloughlin thanks for reviewing

@SuperTux88 SuperTux88 deleted the dont-change-modes branch June 25, 2018 14:24
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

Successfully merging this pull request may close these issues.

3 participants