saltstack-formulas / openssh-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
90 stars 297 forks source link

feat(ssh_known_hosts): allow to omit IP addresses #173

Closed alxwr closed 4 years ago

alxwr commented 4 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Servers like github.com are hosted on multiple IP addresses. When the IP address is retrieved via DNS this leads to a flapping /etc/ssh/ssh_known_hosts. To prevent that fluctuation the Pillar openssh:known_hosts:omit_ip_address was introduced. It can either specify a list of hosts or True.

Pillar / config required to test the proposed changes

I updated test/salt/pillar/default.sls.

Debug log showing how the proposed changes work

host:                                                                                              
----------                                                                                                            
          ID: manage ssh_known_hosts file                                                                             
    Function: file.managed                                                                                            
        Name: /etc/ssh/ssh_known_hosts                                                                                
      Result: None                                                                                                    
     Comment: The file /etc/ssh/ssh_known_hosts is set to be changed                                                  
              Note: No changes made, actual changes may                                                               
              be different due to other states.                                                                       
     Started: 17:07:06.729371                                                                                         
    Duration: 2172.67 ms                                                                                              
     Changes:                                                                                                         
              ----------                                                                                              
              diff:                                                                                                   
                  ---                                                                                                 
                  +++ 
                  @@ -29,6 +29,7 @@
                   […]
                  -github.com,140.82.118.3,140.82.118.4 ssh-rsa AAAAB3NzaC1yc2E[…] git@github.com
                  +github.com ssh-rsa AAAAB3NzaC1yc2E[…] git@github.com
                   […]

Documentation checklist

Testing checklist

Additional context

myii commented 4 years ago

@alxwr Now you're going to get bitten by commitlint!

-chore(README): use in YAML examples
+docs(readme): use in YAML examples

(Not the chore itself but the commit scope must be lowercase).

myii commented 4 years ago

@alxwr Since we can get around the commitlint violation upon (squash and) merge, I've just done that here. Thanks for the contribution. Thanks @aboe76 for the review, as well.

saltstack-formulas-travis commented 4 years ago

:tada: This PR is included in version 0.43.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

alxwr commented 4 years ago

Thanks @myii and @aboe76 !