# edit aix stanza files

**URL:** <https://forum.ansible.com/t/edit-aix-stanza-files/28393>\
**Category:** Ansible Project\
**Created:** [August 22, 2018, 10:29am UTC](https://forum.ansible.com/t/edit-aix-stanza-files/28393 "2018-08-22T10:29:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.tremel](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@christian.tremel](https://forum.ansible.com/u/christian.tremel)\
**Post date:** [August 22, 2018, 10:29am UTC](https://forum.ansible.com/t/edit-aix-stanza-files/28393/1 "2018-08-22T10:29:10Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 22, 2018, 1:06pm UTC](https://forum.ansible.com/t/edit-aix-stanza-files/28393/2 "2018-08-22T13:06:22Z")

</div>

you can try lineinfile or use j2 templates

---

<div class="post-metadata">

**Author:** ![christian.tremel](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@christian.tremel](https://forum.ansible.com/u/christian.tremel)\
**Post date:** [September 18, 2018, 3:13pm UTC](https://forum.ansible.com/t/edit-aix-stanza-files/28393/3 "2018-09-18T15:13:33Z")

</div>

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.
