Last active
December 20, 2015 08:59
-
-
Save raphink/6104418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/augtool -Asf | |
| # Loaded with -A, add association now | |
| set /augeas/load/Pg_Hba/lens Pg_Hba.lns | |
| set /augeas/load/Pg_Hba/incl /etc/postgresql/9.1/main/pg_hba.conf | |
| load | |
| # Make sure file exists | |
| defnode file /files/etc/postgresql/9.1/main/pg_hba.conf | |
| # Check if entry already exists | |
| defvar new $file[count(*[type='hostssl' and database='all' and user='all' and address='samenet'])=0] | |
| # Create new entry | |
| set $new/01/type 'hostssl' | |
| set $new/01/database 'all' | |
| set $new/01/user 'all' | |
| set $new/01/address 'samenet' | |
| set $new/01/method 'md5' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment