I am trying to add multiple new services to /etc/services file. I was able 
to get one entry placed as the last service, but have been unable to insert 
additional entries. 

augtool> set /files/etc/services/service-name[last()] "DB2_db2inst1_1"
augtool> set /files/etc/services/service-name[. = 'DB2_db2inst1_1']/port 
60001
augtool> set /files/etc/services/service-name[. = 
'DB2_db2inst1_1']/protocol tcp
augtool> save
Saved 1 file(s)

cat /etc/services | grep DB_db2inst1_1
DB2_db2inst1_1               60001/tcp

I tried using the service-name[last()+1] to add a service after that last 
one but it errors and will not save using augtool. 

set /files/etc/services/service-name[last()+1] "DB2_db2inst1_2"
set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/port 60002"
set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/protocol tcp"

I would like the output to look like this;
DB2_db2inst1_1               60001/tcp
DB2_db2inst1_2               60002/tcp

Im sure there is a way with Xpath to write to the next line, but I have not 
been successful with it yet. Any thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/uezInlCritIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to