# PAMD module and YAML syntax error

**URL:** <https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510>\
**Category:** Ansible Project\
**Created:** [January 18, 2018, 10:36am UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510 "2018-01-18T10:36:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_Andrews](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Vincent\_Andrews](https://forum.ansible.com/u/Vincent_Andrews)\
**Post date:** [January 18, 2018, 10:36am UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510/1 "2018-01-18T10:36:10Z")

</div>

Hello,

I have created a playbook based on the PAMD module, but it keeps on failing the YAML syntax stage and I am out of ideas. Please help.

Vince.

Head of the file is:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 18, 2018, 11:35am UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510/2 "2018-01-18T11:35:05Z")

</div>

Your are missing 2 spaces in front of the second name.

---

<div class="post-metadata">

**Author:** ![Vincent\_Andrews](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Vincent\_Andrews](https://forum.ansible.com/u/Vincent_Andrews)\
**Post date:** [January 18, 2018, 12:00pm UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510/3 "2018-01-18T12:00:51Z")

</div>

Thanks for your help Kai, the error has move on! Do you think its down to spacing?

# ansible-playbook --syntax-check pamd.yml

**ERROR! ‘pamd’ is not a valid attribute for a Play**

The error appears to have been in ‘/etc/ansible/playbooks/pamd.yml’: line 6, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Insert new rule for pam\_tally2.so  
^ here

# head -20 pamd.yml

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 18, 2018, 12:12pm UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510/4 "2018-01-18T12:12:23Z")

</div>

> Thanks for your help Kai, the error has move on! Do you think its down to  
> spacing?

Sorry I didn't bay attention to the whole file.  
But yes, you are missing 2 spaces in front of all the task.

And you need to remove the dash in front of tasks.

> # ansible-playbook --syntax-check pamd.yml  
> \*ERROR! 'pamd' is not a valid attribute for a Play\*
> 
> The error appears to have been in '/etc/ansible/playbooks/pamd.yml': line  
> 6, column 3, but may  
> be elsewhere in the file depending on the exact syntax problem.
> 
> The offending line appears to be:
> 
> - name: Insert new rule for pam\_tally2.so  
> &nbsp;&nbsp;^ here
> 
> # head -20 pamd.yml  
> ---
> 
> - hosts: all  
> - tasks:
> 
> - name: Insert new rule for pam\_tally2.so  
> &nbsp;&nbsp;pamd:  
> &nbsp;&nbsp;&nbsp;&nbsp;name: system-auth  
> &nbsp;&nbsp;&nbsp;&nbsp;type: auth  
> &nbsp;&nbsp;&nbsp;&nbsp;control: required  
> &nbsp;&nbsp;&nbsp;&nbsp;module\_path: pam\_env.so  
> &nbsp;&nbsp;&nbsp;&nbsp;new\_type: auth  
> &nbsp;&nbsp;&nbsp;&nbsp;new\_control: required  
> &nbsp;&nbsp;&nbsp;&nbsp;module\_arguments: ‘deny=3 unlock\_time=180’  
> &nbsp;&nbsp;&nbsp;&nbsp;new\_module\_path: pam\_tally2.so  
> &nbsp;&nbsp;&nbsp;&nbsp;state: before
> 
> - name: Insert new rule for pam\_cracklib.so  
> &nbsp;&nbsp;pamd:  
> &nbsp;&nbsp;&nbsp;&nbsp;name: system-auth

- hosts: all  
&nbsp;&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;- name: Insert new rule for pam\_tally2.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pamd:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: system-auth  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: auth  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;control: required  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module\_path: pam\_env.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new\_type: auth  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new\_control: required  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;module\_arguments: ‘deny=3 unlock\_time=180’  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new\_module\_path: pam\_tally2.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: before

&nbsp;&nbsp;&nbsp;- name: Insert new rule for pam\_cracklib.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pamd:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: system-auth

---

<div class="post-metadata">

**Author:** ![Vincent\_Andrews](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Vincent\_Andrews](https://forum.ansible.com/u/Vincent_Andrews)\
**Post date:** [January 18, 2018, 2:07pm UTC](https://forum.ansible.com/t/pamd-module-and-yaml-syntax-error/26510/5 "2018-01-18T14:07:56Z")

</div>

It’s all in the indent!

Thanks Kai.
