On 25. juli 2016 02:57, Rick Paxton wrote:
> *playbook:*
> settings.yml
> 1 ---
> 2 - hosts: dbservers
> 3 become: yes
> 4
> 5 tasks:
> 6 - name: insert/update sysctl.conf settings per specifications
> 7 blockinfile:
> 8 backup: yes
> 9 dest: /etc/sysctl.conf
> 10 marker: # {mark} ANSIBLE MANAGED BLOCK
> 11 content: |
> 12 kernel.shmmni = 4096
> 13 kernel.sem = 250 32000 100 128
> 14 fs.file-max = 512 * PROCESSES
> 15 net.ipv4.ip_local_port_range = 1024 6500
> 16 net.core.rmem_default = 4194304
> 17 net.core.rmem_max = 4194304
> 18 net.core.wmem_default = 262144
> 19 net.ipv4.tcp_wmem = 262144 262144 262144
> 20 net.ipv4.tcp_rmem = 4194304 4194304 4194304
>
> *execution:*
> $ ansible-playbook ./playbooks/settings.yml
>
> TASK [insert/update sysctl.conf settings per specifications]
> ****************
> fatal: [ag-rhel6-temp.test.local]: FAILED! => {"changed": false, "failed":
> true, "module_stderr": "", "module_stdout": "Traceback (most recent call
> last):\r\n File \"/tmp/ansible_3oLmj8/ansible_module_blockinfile.py\",
> line 313, in <module>\r\n main()\r\n File
> \"/tmp/ansible_3oLmj8/ansible_module_blockinfile.py\", line 243, in
> main\r\n marker0 = re.sub(r'{mark}', 'BEGIN', marker)\r\n File
> \"/usr/lib64/python2.6/re.py\", line 151, in sub\r\n return
> _compile(pattern, 0).sub(repl, string, count)\r\nTypeError: expected string
> or buffer\r\n", "msg": "MODULE FAILURE", "parsed": false}
It's complaining about marker: not being a string, you need to put
quotes around it.
Since the marker text you are using is the same as the default you can
just delete the marker line.
--
Kai Stian Olstad