Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount module: incorrect command-line arguments used for Solaris. #22135

Closed
AlexZolotarenko opened this issue Mar 1, 2017 · 5 comments · Fixed by #22865
Closed

Mount module: incorrect command-line arguments used for Solaris. #22135

AlexZolotarenko opened this issue Mar 1, 2017 · 5 comments · Fixed by #22865
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module. solaris Solaris community support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@AlexZolotarenko
Copy link
Contributor

AlexZolotarenko commented Mar 1, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

mount module

ANSIBLE VERSION
ansible 2.2.1.0
CONFIGURATION
OS / ENVIRONMENT

Running ansible on ubuntu linux 16.04.1
Controlling hosts with Solaris 11.2/11.3

SUMMARY

mount module uses incorrect command-line arguments for SunOS,
"mount" command on Solaris does not support pointing to fstab file,
but _set_fstab_args(args) do not check if task is running against SunOS and in this case adds "-T path_to_fstab..." to command-line arguments.

STEPS TO REPRODUCE

Just try any mount task with state "mounted" against Solaris.

cat roles/nfs_client/defaults/main.yml

---
nfs_shares:
  - dst:        "/opt/storage"
    dst_owner:  "support"
    dst_mode:   "0755"
    dst_group:  "support"
    src:        "tribune:/opt/storage"

  - dst: "/opt/homes"
    src: "tribune:/opt/nfs/homes"

tail roles/nfs_client/tasks/solaris.yml

  mount:	
    fstype:		"nfs"
    name:		"{{ share.dst }}"
    src:		"{{ share.src }}"
    state:		"mounted"

  with_items:		"{{ nfs_shares }}"
  loop_control:		
    loop_var:		"share"
EXPECTED RESULTS

According to these var and task, two NFS shares mounted on destination server.

ACTUAL RESULTS
failed: [sulla] (item={u'dst_owner': u'support', u'src': u'tribune:/opt/storage', u'dst': u'/opt/storage', u'dst_group': u'support'}) => {"failed": true, "msg": "Error mounting /opt/storage: /sbin/mount: illegal option -- T\nUsage:\nmount [-v | -p]\nmount [-F FSType] [-V] [current_options] [-o specific_options]\n\t{special | mount_point}\nmount [-F FSType] [-V] [current_options] [-o specific_options]\n\tspecial mount_point\nmount -a [-F FSType ] [-V] [current_options] [-o specific_options]\n\t[mount_point ...]\n", "share": {"dst": "/opt/storage", "dst_group": "support", "dst_owner": "support", "src": "tribune:/opt/storage"}}
POTENTIAL FIX
ansible@nero:~$ diff ./library/mount.py ./lib/ansible/modules/core/system/mount.py  
313c313
<     if 'fstab' in args and args['fstab'] != '/etc/fstab' and get_platform().lower() != 'sunos' :
---
>     if 'fstab' in args and args['fstab'] != '/etc/fstab':
ansible@nero:~$ 
@ansibot ansibot added affects_2.2 This issue/PR affects Ansible v2.2 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Mar 1, 2017
@jctanner
Copy link
Contributor

jctanner commented Mar 3, 2017

@AlexZolotarenko would you be able to submit a pullrequest for that patch?

needs_info

@jctanner jctanner removed the needs_triage Needs a first human triage before being processed. label Mar 3, 2017
@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 3, 2017
@ansibot
Copy link
Contributor

ansibot commented Mar 21, 2017

@AlexZolotarenko This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. and removed needs_info This issue requires further information. Please answer any outstanding questions. labels Mar 21, 2017
@AlexZolotarenko
Copy link
Contributor Author

I'm not a developer and have no experience with git other that "checkout".
Created Pull Request 22865

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Mar 22, 2017
@ansibot ansibot added the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Jun 29, 2017
@ansibot
Copy link
Contributor

ansibot commented Aug 24, 2017

cc @jtyr
click here for bot help

@jtyr
Copy link
Contributor

jtyr commented Aug 24, 2017

Linking the PR #22865.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@dagwieers dagwieers added the solaris Solaris community label Jan 9, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug. module This issue/PR relates to a module. solaris Solaris community support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants