"keep" and "exclude_pat" are being ignored on "file.recurse"
@MKLeb is already working on this.
Since Sep 8, 2023.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue/Question
It appears that when using file.recurse with templates and the setting file_mode: keep, that the mode of the original file is not kept. Also, it appears that exclude_pat is being ignored too. Note: this is in a masterless setup, with /srv/salt being the root of my salt states.
Setup
install-gitolite-local:
file.recurse:
- name: /srv/git/non-core
- source: salt://gitolite/files/local
- dir_mode: 0755
- file_mode: keep
- user: git
- group: git
- exclude_pat: .*.sw*
- clean: True
- template: jinja
- defaults:
in_vagrant: {{ in_vagrant }}
- require:
- file: install-gitolite-rc
Steps to Reproduce Issue
I'm using the above to mirror a local file tree to the appropriate location on the server. In that tree are some executable files. All of the files have their executable bit set, except for a couple. Several of the files make use of the fact of whether I'm running under vagrant or not to change their behavior. Unfortunately, after this state is run, none of the files have their executable bit set. Moreover, the .*.sw* have been mirrored into the destination.
Versions Report
I'm using a masterless setup right now.
:: salt-call --versions-report
Salt Version:
Salt: 2016.11.1
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.4.0-31-generic
system: Linux
version: Ubuntu 16.04 xenial
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.