edit aix stanza files

57 views
Skip to first unread message

christia...@itsv.at

unread,
Aug 22, 2018, 6:29:10 AM8/22/18
to Ansible Project
hi all,

any way to edit so called "stanza files" in aix? i read about the blockinfile module but this seems not to be the best way to do it, since it depends on markers which will break aix configs.

example of such stanza files:

srvproxy:
        admin
= false
        umask
= 2
        login
= false
        rlogin
= false

usw
:
        shells
= /bin/sh,/bin/bsh,/bin/csh,/bin/ksh,/bin/tsh,/bin/ksh93,/usr/bin/sh,/usr/bin/bsh,/usr/bin/csh,/usr/bin/ksh,/usr/bin/tsh,/usr/bin/ksh93,/usr/bin/rksh,/usr/bin/rksh93,/usr/sbin/uucp/uucico,/usr/sbin/sliplogin,/usr/sbin/snappd,/bin/false,/usr/bin/bash
        maxlogins
= 32767
        logintimeout
= 60
        auth_type
= STD_AUTH
        pwd_algorithm
= sshaitsv


for example i want to adress the "srcproxy:" and add or delete "pwd_algorithm = sshaitsv", or add new items "somestanza:". any ideas?

wbr

chris

Jonathan Lozada De La Matta

unread,
Aug 22, 2018, 9:06:56 AM8/22/18
to ansible...@googlegroups.com
you can try lineinfile or use j2 templates

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ec00d38a-4549-40df-bced-b0c6239fac4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION CONSULTANT - AUTOMATION PRACTICE

Red Hat Consulting Services

jloz...@redhat.com   



 

christia...@itsv.at

unread,
Sep 18, 2018, 11:13:33 AM9/18/18
to Ansible Project
hmm...tried out lineinfile, replace and template but was not successfull? any other creative ideas? i looked at the ini_file module source, and it seems this is very similar to the aix stanza format. unfortunately i am at war with regex, and this particular code is full of it.
Reply all
Reply to author
Forward
0 new messages