Skip to content

augeas issue with apache and recognizing changes that have been already made #24275

Closed

Description

@kartiksubbarao

This is possibly related to #24274, but in case it isn't, I'm reporting it as a separate issue. The following state is always run by salt, even if the change has already been made:

/etc/apache2/sites-available/default-ssl.conf:
  augeas.change:
    - context: /files/etc/apache2/sites-available/default-ssl.conf/IfModule/VirtualHost
    - changes:
      - set directive[. = "SSLCertificateFile"]/arg /etc/ssl/certs/cert1.pem

I have to include something like - unless: grep -q cert1.pem /etc/apache2/sites-available/default-ssl.conf to prevent salt from rerunning the state.

Activity

  1. kartiksubbarao commented on May 31, 2015

    @kartiksubbarao
    ContributorAuthor

    Found the problem -- context: needs to resolve to an actual file (as opposed to an arbitrary augeas path) in order for salt to determine the filename for comparing the old state vs the changed state. The following state works fine:

    /etc/apache2/sites-available/default-ssl.conf:
      augeas.change:
        - context: /files/etc/apache2/sites-available/default-ssl.conf
        - changes:
          - set IfModule/VirtualHost/directive[. = "SSLCertificateFile"]/arg /etc/ssl/certs/cert1.pem

    It might be good to mention this more explicitly in the documentation. The current phrasing implies that setting context to a file path is just a convenience to avoid redundancy, whereas it is actually required if the desired behavior is not to make changes to a file that has already been changed.

  2. added
    documentation
    bug
    severity-medium
    P3
    Platform
    on Jun 5, 2015
  3. added this to the Approved milestone on Jun 5, 2015
  4. jfindlay commented on Jun 5, 2015

    @jfindlay
    Contributor

    @kartiksubbarao, thanks for the report.

  5. added a commit that references this issue on Jun 12, 2015
  6. added
    fixed-pls-verify
    on Jun 18, 2015
  7. kartiksubbarao commented on Jun 18, 2015

    @kartiksubbarao
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3PlatformState-Modulebugdocumentationfixed-pls-verifyseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions