I am passing in these options to the mount module:

- name: Create fstab entries for custom mount points, and mount
  mount:
    fstype: "{{ item.type }}"
    name: "{{ item.name }}"
    src: "{{ item.src }}"
    passno: 10
    state: mounted
  when:
    - "{{ gluster_mounts | length  > 0 }}"
  with_items:
    - "{{ gluster_mounts }}"

The hash looks like this:

gluster_mounts:
  - name: "{{ mail_mount }}"
    src: vmserver-a.kugler.localdomain:/export/email/brick
    type: glusterfs
    owner: dovecot
    group: dovecot
  - name: "{{ list_archive_mount }}"
    src: vmserver-a.kugler.localdomain:/export/list_archive/brick
    type: glusterfs
    owner: dovecot
    group: dovecot

The error generated is attached, but the important part is this:

AttributeError: 'int' object has no attribute 'replace'

The documentation doesn't say that 'passno' should be a string (and since it 
is a number, one would not expect it to be a string). However, when I put 10 
in quotes, like '10' the command runs to completion without throwing the error 
(that is, the lines get added to /etc/fstab).

Should the mount module be able to accept an integer for the passno parameter?

j

-- 
Joshua J. Kugler - Fairbanks, Alaska
Azariah Enterprises - Programming and Website Design
[email protected] - Jabber: [email protected]
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2255302.7BCmuK3Djk%40hosanna.
For more options, visit https://groups.google.com/d/optout.
failed: [mailserver-a.kugler.localdomain] => (item={u'owner': u'postfix', 
u'src': u'vmserver-a.kugler.localdomain:/export/email/brick', u'type': 
u'glusterfs', u'name': u'/var/spool/mail', u'group': u'postfix'}) => {"failed": 
true, "item": {"group": "postfix", "name": "/var/spool/mail", "owner": 
"postfix", "src": "vmserver-a.kugler.localdomain:/export/email/brick", "type": 
"glusterfs"}, "module_stderr": "", "module_stdout": "Traceback (most recent 
call last):\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079935.96-2223629745112/mount\", line 
2346, in <module>\r\n    main()\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079935.96-2223629745112/mount\", line 354, 
in main\r\n    name, changed = set_mount(module, **args)\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079935.96-2223629745112/mount\", line 134, 
in set_mount\r\n    escaped_args = dict([(k, _escape_fstab(v)) for k, v in 
args.iteritems()])\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079935.96-2223629745112/mount\", line 110, 
in _escape_fstab\r\n    return v.replace('\\\\', '\\\\134').replace(' ', 
'\\\\040').replace('&', '\\\\046')\r\nAttributeError: 'int' object has no 
attribute 'replace'\r\n", "msg": "MODULE FAILURE", "parsed": false}
failed: [mailserver-a.kugler.localdomain] => (item={u'owner': u'postfix', 
u'src': u'vmserver-a.kugler.localdomain:/export/list_archive/brick', u'type': 
u'glusterfs', u'name': u'/var/spool/list_archive', u'group': u'postfix'}) => 
{"failed": true, "item": {"group": "postfix", "name": 
"/var/spool/list_archive", "owner": "postfix", "src": 
"vmserver-a.kugler.localdomain:/export/list_archive/brick", "type": 
"glusterfs"}, "module_stderr": "", "module_stdout": "Traceback (most recent 
call last):\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079936.13-156638996947719/mount\", line 
2346, in <module>\r\n    main()\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079936.13-156638996947719/mount\", line 
354, in main\r\n    name, changed = set_mount(module, **args)\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079936.13-156638996947719/mount\", line 
134, in set_mount\r\n    escaped_args = dict([(k, _escape_fstab(v)) for k, v in 
args.iteritems()])\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1460079936.13-156638996947719/mount\", line 
110, in _escape_fstab\r\n    return v.replace('\\\\', '\\\\134').replace(' ', 
'\\\\040').replace('&', '\\\\046')\r\nAttributeError: 'int' object has no 
attribute 'replace'\r\n", "msg": "MODULE FAILURE", "parsed": false}

Reply via email to