<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">file related modules like <code class="notranslate">file</code>, <code class="notranslate">template</code> that have a <code class="notranslate">mode</code> parameter</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
  config file = /home/kon/venvs/ansible-test/etc/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
  config file = /home/kon/venvs/ansible-test/etc/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">just an entry for the inventory path</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Linux ktsakiltzidis 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.2 (stretch)
Release:	9.2
Codename:	stretch"><pre class="notranslate"><code class="notranslate">Linux ktsakiltzidis 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.2 (stretch)
Release:	9.2
Codename:	stretch
</code></pre></div>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">using a loop that passes item in the <code class="notranslate">mode</code> parameter<br>
results in chmod complaining with <code class="notranslate">mode must be in octal or symbolic form</code></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- hosts: localhost
  tasks:
    - name: test file mode
      template:
        src: testfile.j2
        dest: ~/testing/ansible/testfile{{ item.index }}
        mode: &quot;{{ item.mode }}&quot;
      with_items:
        - index: 0
          mode: 0600
        - index: 1
          mode: 0640"><pre class="notranslate">- <span class="pl-ent">hosts</span>: <span class="pl-s">localhost</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">test file mode</span>
      <span class="pl-ent">template</span>:
        <span class="pl-ent">src</span>: <span class="pl-s">testfile.j2</span>
        <span class="pl-ent">dest</span>: <span class="pl-s">~/testing/ansible/testfile{{ item.index }}</span>
        <span class="pl-ent">mode</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item.mode }}<span class="pl-pds">"</span></span>
      <span class="pl-ent">with_items</span>:
        - <span class="pl-ent">index</span>: <span class="pl-c1">0</span>
          <span class="pl-ent">mode</span>: <span class="pl-c1">0600</span>
        - <span class="pl-ent">index</span>: <span class="pl-c1">1</span>
          <span class="pl-ent">mode</span>: <span class="pl-c1">0640</span></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">no errors, right permissions</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [test apt package list] ***************************************************
failed: [localhost] (item={u'index': 0, u'mode': 384}) =&gt; {&quot;details&quot;: &quot;bad symbolic permission for mode: 384&quot;, &quot;failed&quot;: true, &quot;gid&quot;: 1000, &quot;group&quot;: &quot;kon&quot;, &quot;item&quot;: {&quot;index&quot;: 0, &quot;mode&quot;: 384}, &quot;mode&quot;: &quot;0666&quot;, &quot;msg&quot;: &quot;mode must be in octal or symbolic form&quot;, &quot;owner&quot;: &quot;kon&quot;, &quot;path&quot;: &quot;/home/kon/testing/ansible/testfile0&quot;, &quot;size&quot;: 0, &quot;state&quot;: &quot;file&quot;, &quot;uid&quot;: 1000}
ok: [localhost] =&gt; (item={u'index': 1, u'mode': 416})
"><pre class="notranslate"><code class="notranslate">TASK [test apt package list] ***************************************************
failed: [localhost] (item={u'index': 0, u'mode': 384}) =&gt; {"details": "bad symbolic permission for mode: 384", "failed": true, "gid": 1000, "group": "kon", "item": {"index": 0, "mode": 384}, "mode": "0666", "msg": "mode must be in octal or symbolic form", "owner": "kon", "path": "/home/kon/testing/ansible/testfile0", "size": 0, "state": "file", "uid": 1000}
ok: [localhost] =&gt; (item={u'index': 1, u'mode': 416})

</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
<li>Feature Idea</li>
<li>Documentation Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">ansible-playbook</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">host_key_checking = False</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">Ansible control server: Red Hat Enterprise Linux Server release 7.4 (Maipo)<br>
Node: Red Hat Enterprise Linux Server release 7.4 (Maipo)</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">I have a variable that is a list.  Within that list I have a a value called mount_mode set to 0755.  When iterating through the list in a loop (with_items) the 0755 value gets interpreted as 493.  The only work-around I found is to wrap the 0755 with single-quotes.  If I place a variable outside of the list called mode with value 0755 and refer to it in the loop, the 0755 gets interpreted properly without single-quotes.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- hosts: servers
  vars:
    lvm_lvs:
      - name: Data Volume
        vg: vg_myvg1
        lv: lv_data
        size: 25g
        mount: /data/mydata
        mount_owner: root
        mount_group: root
        mount_mode: 0755
        mount_dump: 1
        mount_passno: 2
        mount_opts: defaults
        fstype: xfs
  roles:
    - { role: lvm }"><pre class="notranslate">- <span class="pl-ent">hosts</span>: <span class="pl-s">servers</span>
  <span class="pl-ent">vars</span>:
    <span class="pl-ent">lvm_lvs</span>:
      - <span class="pl-ent">name</span>: <span class="pl-s">Data Volume</span>
        <span class="pl-ent">vg</span>: <span class="pl-s">vg_myvg1</span>
        <span class="pl-ent">lv</span>: <span class="pl-s">lv_data</span>
        <span class="pl-ent">size</span>: <span class="pl-c1">25g</span>
        <span class="pl-ent">mount</span>: <span class="pl-s">/data/mydata</span>
        <span class="pl-ent">mount_owner</span>: <span class="pl-s">root</span>
        <span class="pl-ent">mount_group</span>: <span class="pl-s">root</span>
        <span class="pl-ent">mount_mode</span>: <span class="pl-c1">0755</span>
        <span class="pl-ent">mount_dump</span>: <span class="pl-c1">1</span>
        <span class="pl-ent">mount_passno</span>: <span class="pl-c1">2</span>
        <span class="pl-ent">mount_opts</span>: <span class="pl-s">defaults</span>
        <span class="pl-ent">fstype</span>: <span class="pl-s">xfs</span>
  <span class="pl-ent">roles</span>:
    - <span class="pl-s">{ role: lvm }</span></pre></div>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#Set permissions on mount points
- name: Ensure mount point has desired permissions
  file:
    path: &quot;{{ item.mount }}&quot;
    owner: &quot;{{ item.mount_owner }}&quot;
    group: &quot;{{ item.mount_group }}&quot;
    mode: &quot;{{ item.mount_mode }}&quot;
  with_items: &quot;{{ lvm_lvs }}&quot;"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>Set permissions on mount points</span>
- <span class="pl-ent">name</span>: <span class="pl-s">Ensure mount point has desired permissions</span>
  <span class="pl-ent">file</span>:
    <span class="pl-ent">path</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item.mount }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">owner</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item.mount_owner }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">group</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item.mount_group }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">mode</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item.mount_mode }}<span class="pl-pds">"</span></span>
  <span class="pl-ent">with_items</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ lvm_lvs }}<span class="pl-pds">"</span></span></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">{{ item.mount_mode }} should be interpreted as 0755, but instead it gets interpreted as 493.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [lvm : Ensure mount point has desired permissions] ****************************************************************************************************************
task path: /home/TESTNET/ap574009/rhel5-eol/migrate_9306/roles/lvm/tasks/main.yml:40
Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/file.py
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '&quot;'&quot;'echo ~ &amp;&amp; sleep 0'&quot;'&quot;''
&lt;rhel5_test7&gt; (0, '/home/TESTNET/ap574009\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447 `&quot; &amp;&amp; echo ansible-tmp-1508446533.04-211671926774447=&quot;` echo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;''
&lt;rhel5_test7&gt; (0, 'ansible-tmp-1508446533.04-211671926774447=/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; PUT /tmp/tmptaK6vo TO /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 '[rhel5_test7]'
&lt;rhel5_test7&gt; (0, 'sftp&gt; put /tmp/tmptaK6vo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension &quot;posix-rename@openssh.com&quot; revision 1\r\ndebug2: Server supports extension &quot;statvfs@openssh.com&quot; revision 2\r\ndebug2: Server supports extension &quot;fstatvfs@openssh.com&quot; revision 2\r\ndebug2: Server supports extension &quot;hardlink@openssh.com&quot; revision 1\r\ndebug2: Server supports extension &quot;fsync@openssh.com&quot; revision 1\r\ndebug3: Sent message fd 6 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -&gt; /home/TESTNET/ap574009 size 0\r\ndebug3: Looking up /tmp/tmptaK6vo\r\ndebug3: Sent message fd 6 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:28758\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 28758 bytes at 32768\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '&quot;'&quot;'chmod u+x /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/ /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py &amp;&amp; sleep 0'&quot;'&quot;''
&lt;rhel5_test7&gt; (0, '', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 -tt rhel5_test7 '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-pxllydjcdclgergkezgvynrsosfwocjq; /usr/bin/python /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py; rm -rf &quot;/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;''
&lt;rhel5_test7&gt; (0, '\r\n{&quot;group&quot;: &quot;root&quot;, &quot;uid&quot;: 0, &quot;mode&quot;: &quot;0755&quot;, &quot;failed&quot;: true, &quot;state&quot;: &quot;directory&quot;, &quot;gid&quot;: 0, &quot;secontext&quot;: &quot;system_u:object_r:unlabeled_t:s0&quot;, &quot;details&quot;: &quot;bad symbolic permission for mode: 493&quot;, &quot;invocation&quot;: {&quot;module_args&quot;: {&quot;directory_mode&quot;: null, &quot;force&quot;: false, &quot;remote_src&quot;: null, &quot;path&quot;: &quot;/data/mydata&quot;, &quot;owner&quot;: &quot;root&quot;, &quot;follow&quot;: false, &quot;group&quot;: &quot;root&quot;, &quot;unsafe_writes&quot;: null, &quot;state&quot;: null, &quot;content&quot;: null, &quot;serole&quot;: null, &quot;diff_peek&quot;: null, &quot;setype&quot;: null, &quot;selevel&quot;: null, &quot;original_basename&quot;: null, &quot;regexp&quot;: null, &quot;validate&quot;: null, &quot;src&quot;: null, &quot;seuser&quot;: null, &quot;recurse&quot;: false, &quot;delimiter&quot;: null, &quot;mode&quot;: &quot;493&quot;, &quot;attributes&quot;: null, &quot;backup&quot;: null}}, &quot;owner&quot;: &quot;root&quot;, &quot;path&quot;: &quot;/data/mydata&quot;, &quot;size&quot;: 6, &quot;msg&quot;: &quot;mode must be in octal or symbolic form&quot;}\r\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to rhel5_test7 closed.\r\n')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/file.py
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '&quot;'&quot;'echo ~ &amp;&amp; sleep 0'&quot;'&quot;''
failed: [rhel5_test7] (item={u'name': u'Data Volume', u'vg': u'vg_myvg1', u'mount_group': u'root', u'mount': u'/data/mydata', u'fstype': u'xfs', u'lv': u'lv_data', u'mount_owner': u'root', u'mount_mode': 493, u'mount_dump': 1, u'mount_passno': 2, u'mount_opts': u'defaults', u'size': u'25g'}) =&gt; {
    &quot;details&quot;: &quot;bad symbolic permission for mode: 493&quot;,
    &quot;failed&quot;: true,
    &quot;gid&quot;: 0,
    &quot;group&quot;: &quot;root&quot;,
    &quot;invocation&quot;: {
        &quot;module_args&quot;: {
            &quot;attributes&quot;: null,
            &quot;backup&quot;: null,
            &quot;content&quot;: null,
            &quot;delimiter&quot;: null,
            &quot;diff_peek&quot;: null,
            &quot;directory_mode&quot;: null,
            &quot;follow&quot;: false,
            &quot;force&quot;: false,
            &quot;group&quot;: &quot;root&quot;,
            &quot;mode&quot;: &quot;493&quot;,
            &quot;original_basename&quot;: null,
            &quot;owner&quot;: &quot;root&quot;,
            &quot;path&quot;: &quot;/data/mydata&quot;,
            &quot;recurse&quot;: false,
            &quot;regexp&quot;: null,
            &quot;remote_src&quot;: null,
            &quot;selevel&quot;: null,
            &quot;serole&quot;: null,
            &quot;setype&quot;: null,
            &quot;seuser&quot;: null,
            &quot;src&quot;: null,
            &quot;state&quot;: null,
            &quot;unsafe_writes&quot;: null,
            &quot;validate&quot;: null
        }
    },
    &quot;item&quot;: {
        &quot;fstype&quot;: &quot;xfs&quot;,
        &quot;lv&quot;: &quot;lv_data&quot;,
        &quot;mount&quot;: &quot;/data/mydata&quot;,
        &quot;mount_dump&quot;: 1,
        &quot;mount_group&quot;: &quot;root&quot;,
        &quot;mount_mode&quot;: 493,
        &quot;mount_opts&quot;: &quot;defaults&quot;,
        &quot;mount_owner&quot;: &quot;root&quot;,
        &quot;mount_passno&quot;: 2,
        &quot;name&quot;: &quot;Data Volume&quot;,
        &quot;size&quot;: &quot;25g&quot;,
        &quot;vg&quot;: &quot;vg_myvg1&quot;
    },
    &quot;mode&quot;: &quot;0755&quot;,
    &quot;msg&quot;: &quot;mode must be in octal or symbolic form&quot;,
    &quot;owner&quot;: &quot;root&quot;,
    &quot;path&quot;: &quot;/data/mydata&quot;,
    &quot;secontext&quot;: &quot;system_u:object_r:unlabeled_t:s0&quot;,
    &quot;size&quot;: 6,
    &quot;state&quot;: &quot;directory&quot;,
    &quot;uid&quot;: 0
}"><pre class="notranslate"><code class="notranslate">TASK [lvm : Ensure mount point has desired permissions] ****************************************************************************************************************
task path: /home/TESTNET/ap574009/rhel5-eol/migrate_9306/roles/lvm/tasks/main.yml:40
Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/file.py
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '"'"'echo ~ &amp;&amp; sleep 0'"'"''
&lt;rhel5_test7&gt; (0, '/home/TESTNET/ap574009\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447 `" &amp;&amp; echo ansible-tmp-1508446533.04-211671926774447="` echo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447 `" ) &amp;&amp; sleep 0'"'"''
&lt;rhel5_test7&gt; (0, 'ansible-tmp-1508446533.04-211671926774447=/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; PUT /tmp/tmptaK6vo TO /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 '[rhel5_test7]'
&lt;rhel5_test7&gt; (0, 'sftp&gt; put /tmp/tmptaK6vo /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "posix-rename@openssh.com" revision 1\r\ndebug2: Server supports extension "statvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "fstatvfs@openssh.com" revision 2\r\ndebug2: Server supports extension "hardlink@openssh.com" revision 1\r\ndebug2: Server supports extension "fsync@openssh.com" revision 1\r\ndebug3: Sent message fd 6 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -&gt; /home/TESTNET/ap574009 size 0\r\ndebug3: Looking up /tmp/tmptaK6vo\r\ndebug3: Sent message fd 6 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:28758\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 28758 bytes at 32768\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '"'"'chmod u+x /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/ /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py &amp;&amp; sleep 0'"'"''
&lt;rhel5_test7&gt; (0, '', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 -tt rhel5_test7 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-pxllydjcdclgergkezgvynrsosfwocjq; /usr/bin/python /home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/file.py; rm -rf "/home/TESTNET/ap574009/.ansible/tmp/ansible-tmp-1508446533.04-211671926774447/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"''
&lt;rhel5_test7&gt; (0, '\r\n{"group": "root", "uid": 0, "mode": "0755", "failed": true, "state": "directory", "gid": 0, "secontext": "system_u:object_r:unlabeled_t:s0", "details": "bad symbolic permission for mode: 493", "invocation": {"module_args": {"directory_mode": null, "force": false, "remote_src": null, "path": "/data/mydata", "owner": "root", "follow": false, "group": "root", "unsafe_writes": null, "state": null, "content": null, "serole": null, "diff_peek": null, "setype": null, "selevel": null, "original_basename": null, "regexp": null, "validate": null, "src": null, "seuser": null, "recurse": false, "delimiter": null, "mode": "493", "attributes": null, "backup": null}}, "owner": "root", "path": "/data/mydata", "size": 6, "msg": "mode must be in octal or symbolic form"}\r\n', 'OpenSSH_7.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 1655\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to rhel5_test7 closed.\r\n')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/file.py
&lt;rhel5_test7&gt; ESTABLISH SSH CONNECTION FOR USER: ap574009
&lt;rhel5_test7&gt; SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=ap574009 -o ConnectTimeout=30 -o ControlPath=/home/TESTNET/ap574009/.ansible/cp/1049f838b2 rhel5_test7 '/bin/sh -c '"'"'echo ~ &amp;&amp; sleep 0'"'"''
failed: [rhel5_test7] (item={u'name': u'Data Volume', u'vg': u'vg_myvg1', u'mount_group': u'root', u'mount': u'/data/mydata', u'fstype': u'xfs', u'lv': u'lv_data', u'mount_owner': u'root', u'mount_mode': 493, u'mount_dump': 1, u'mount_passno': 2, u'mount_opts': u'defaults', u'size': u'25g'}) =&gt; {
    "details": "bad symbolic permission for mode: 493",
    "failed": true,
    "gid": 0,
    "group": "root",
    "invocation": {
        "module_args": {
            "attributes": null,
            "backup": null,
            "content": null,
            "delimiter": null,
            "diff_peek": null,
            "directory_mode": null,
            "follow": false,
            "force": false,
            "group": "root",
            "mode": "493",
            "original_basename": null,
            "owner": "root",
            "path": "/data/mydata",
            "recurse": false,
            "regexp": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": null,
            "state": null,
            "unsafe_writes": null,
            "validate": null
        }
    },
    "item": {
        "fstype": "xfs",
        "lv": "lv_data",
        "mount": "/data/mydata",
        "mount_dump": 1,
        "mount_group": "root",
        "mount_mode": 493,
        "mount_opts": "defaults",
        "mount_owner": "root",
        "mount_passno": 2,
        "name": "Data Volume",
        "size": "25g",
        "vg": "vg_myvg1"
    },
    "mode": "0755",
    "msg": "mode must be in octal or symbolic form",
    "owner": "root",
    "path": "/data/mydata",
    "secontext": "system_u:object_r:unlabeled_t:s0",
    "size": 6,
    "state": "directory",
    "uid": 0
}
</code></pre></div>