User Tools

Site Tools


augeas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

augeas [2016/07/07 16:28]
k2patel created
augeas [2020/08/10 02:35]
Line 1: Line 1:
-====== Augeas ====== 
  
-this is nice tool to modify / edit file using script or puppet. 
- 
-Here are the few command line reference || example. 
- 
-==== Using with Puppet ==== 
-Inbuilt lenses. 
-<code ruby> 
-augeas { "​sudoers":​ 
-  lens    => "​Sudoers.lns",​ 
-  incl    => "/​foo/​sudoers",​ 
-  changes => "​...",​ 
-} 
-</​code>​ 
- 
-Adding new file to modify. 
-<code ruby> 
-   ​augeas { "​idmapd_reg":​ 
-      lens   => "​Phpvars.lns",​ 
-      incl   => "/​etc/​idmapd.conf",​ 
-      changes => [ 
-         "​set General/​Domain '​k2patel.in'",​ 
-       ], 
-   } 
-</​code>​ 
- 
-==== Command line ==== 
- 
-How to use it on command line. use case may vary.<​BR>​ 
-Please see below for some command i use many times. 
- 
-Usecase 1: 
-<code bash> 
-set /​augeas/​load/​Phpvars/​lens "​Phpvars.lns"​ 
-set /​augeas/​load/​Phpvars/​incl "/​var/​www/​vhosts/​k2patel.in/​sites/​default/​settings.php"​ 
- 
-print /​augeas/​load 
- 
-Search for your newly added stuff. 
- 
-load 
-</​code>​ 
- 
-Usecase 2: 
-<code bash> 
-augtool -At "​Simplelines.lns incl /​usr/​share/​tomcat/​conf/​logging.properties"​ 
- 
-/​files/​usr/​share/​tomcat/​conf/​logging.properties/​21 = "​org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/​host-manager].level = INFO" 
-/​files/​usr/​share/​tomcat/​conf/​logging.properties/​19 = "​org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/​manager].level = INFO" 
-/​files/​usr/​share/​tomcat/​conf/​logging.properties/​17 = "​org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO" 
-</​code>​ 
- 
-You can run '​augtool'​ and serch for the lenses provided in `ls /​augeas/​load/​` 
augeas.txt ยท Last modified: 2020/08/10 02:35 (external edit)