So, I want to add two lines to each of two files. Looking to see if lineinfile could add multiple lines, I found a post that seemed to indicate it could not.
1) Is it possible to make lineinfile add multiple lines?
2) If not, is there a way to do something like:
- name: Lock accounts after 3 unsuccessful logon attempts
lineinfile: dest=/etc/pam.d/{{item1}}-auth-ac
regexp='^auth\ [default=die]\ pam_faillock\.so\ authfail\ deny=3\ unlock_time=604800\ fail_interval=900'
insertafter='^auth.*pam_unix\.so.*' line='$item2'
with_items2:
- 'auth [default=die] pam_faillock.so authfail deny=3 unlock_time=604800 fail_interval=900'
- 'auth required pam_faillock.so authsucc deny=3 unlock_time=604800 fail_interval=900'
with_items1:
- system
- password