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

loops and mode in modules like file,template cause chmod to complain #32400

Closed
ghost opened this issue Oct 31, 2017 · 5 comments
Closed

loops and mode in modules like file,template cause chmod to complain #32400

ghost opened this issue Oct 31, 2017 · 5 comments
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ghost
Copy link

ghost commented Oct 31, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

file related modules like file, template that have a mode parameter

ANSIBLE VERSION
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]
CONFIGURATION

just an entry for the inventory path

OS / ENVIRONMENT
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
SUMMARY

using a loop that passes item in the mode parameter
results in chmod complaining with mode must be in octal or symbolic form

STEPS TO REPRODUCE
- hosts: localhost
  tasks:
    - name: test file mode
      template:
        src: testfile.j2
        dest: ~/testing/ansible/testfile{{ item.index }}
        mode: "{{ item.mode }}"
      with_items:
        - index: 0
          mode: 0600
        - index: 1
          mode: 0640
EXPECTED RESULTS

no errors, right permissions

ACTUAL RESULTS
TASK [test apt package list] ***************************************************
failed: [localhost] (item={u'index': 0, u'mode': 384}) => {"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] => (item={u'index': 1, u'mode': 416})

@ghost ghost changed the title loops and mode in modules like file,template loops and mode in modules like file,template cause chmod to complain Oct 31, 2017
@ansibot
Copy link
Contributor

ansibot commented Oct 31, 2017

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 31, 2017
@sivel
Copy link
Member

sivel commented Oct 31, 2017

Duplicate of #31952

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed Oct 31, 2017
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Oct 31, 2017
@ghost
Copy link
Author

ghost commented Oct 31, 2017

@sivel the duplicate is closed though, isn't this considered a bug? maybe this should remain open for reference ?

@sivel
Copy link
Member

sivel commented Oct 31, 2017

It is a duplicate of a closed issue that is not considered a bug, thus this issue is not considered a bug. There is explanation in the other issue, and it also includes reference to other work that may resolve this in the future.

@ghost
Copy link
Author

ghost commented Oct 31, 2017

@sivel i don't see how this is not a bug when following an example in the docs results in an unexpected behavior and error, maybe the docs should change? i understand it's an upstream bug so how can not this be a bug for ansible? maybe this or the original #31952 should remain open for reference until this is fixed?

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@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.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

2 participants