Skip to content

Conversation

@litnialex
Copy link

@litnialex litnialex commented Feb 19, 2021

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

merging pillar key 'letsencrypt' with grains key 'letsencrypt' removes the necessity to define individual domainsets per minion in pillar.
With these changes one cand use such sls:

include:
  - ..letsencrypt

letsencrypt-set-domain:
  grains.present:
    - name: letsencrypt:domainsets:www
    - value:
        - '{{ salt['config.get']('fqdn') }}'
    - force: yes
    - require_in:
        - letsencrypt-config

And every minion with get it's own cert, provided it's grains.fqdn is resovlable. If not, one can run
salt-call grains.append letsencrypt:domainsets:www www.example.com
and then run letsencrypt formula.

Submitted changed do no harm, even if grans lack letsencrypt key.

Change in letsencrypt/domains.sls improve behaviour when domainsets is not defined.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

...
----------               
          ID: /usr/bin/certbot renew      
    Function: file.absent
      Result: True        
     Comment: File /usr/bin/certbot renew is not present
     Started: 14:29:53.125323            
    Duration: 1.638 ms
     Changes:                                                                          
----------                   
          ID: letsencrypt-no-domainsets
    Function: test.fail_without_changes
      Result: False             
     Comment: No domainsets defined for letsencrypt
     Started: 14:29:53.833044          
    Duration: 1.109 ms                                                                 
     Changes:                                                                          
                                           
Summary for 90520732028390                                                             
------------                               
Succeeded: 8                    
Failed:    1
------------
Total states run:     9

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

Install epel-release package prior to certbot package.
Differentiate certbot package name in CentOS 7 and CentOS 8.
Install epel-release package prior to certbot package.
Differentiate certbot package name in CentOS 7 and CentOS 8.
@litnialex litnialex changed the title Allow defining domainsets in grains Fix for CentOS 7 and 8 Feb 21, 2021
@litnialex litnialex requested a review from a team as a code owner December 4, 2021 09:14
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.

1 participant