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

[BUG] Salt does not realize a file to be copied on a minion has been changed #58961

Closed
iosonoumberto opened this issue Nov 17, 2020 · 3 comments
Assignees
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Milestone

Comments

@iosonoumberto
Copy link

iosonoumberto commented Nov 17, 2020

I have this state file

/root/ninja.txt:
  file.managed:
    - source: http://10.102.240.125/contrail/ninja.txt
    - user: root
    - group: root
    - mode: 644
    **- skip_verify: True**
    **- keep_source: False**
    - show_changes: True
    - template: jinja
    - defaults:
        subnet: {{ pillar['subnet'] }}

that I use to copy ninja.txt to a minion

My file looks like this

[root@salt states]# cat /var/www/html/contrail/ninja.txt

cane
{{ subnet }}

so i expect fo find on my minion something like

cane
255.255.255.0

and this is what I get!

at the same time, due to keep_source=False, I expect salt not to keep a cached copy of the file. Is this expectation correct?

Next, i modify my ninja file as follows

[root@salt states]# cat /var/www/html/contrail/ninja.txt

cane
SSSfff
{{ subnet }}

and i re-apply the state
expecting to fin this on minion

cane
SSSfff
255.255.255.0

instead, nothing changed...still the old file

here is my version

[root@salt states]# salt --versions-report
Salt Version:
Salt: 3002.1

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.8.1
libgit2: Not Installed
M2Crypto: 0.33.0
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.6.2
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Oct 13 2020, 16:18:22)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 17.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.4

System Versions:
dist: centos 7 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-693.11.1.el7.x86_64
system: Linux
version: CentOS Linux 7 Core

@iosonoumberto iosonoumberto added the Bug broken, incorrect, or confusing behavior label Nov 17, 2020
@welcome
Copy link

welcome bot commented Nov 17, 2020

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at core@saltstack.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@garethgreenaway
Copy link
Contributor

@iosonoumberto Thanks for the report. The reason you're not seeing the updated file is because of the skip_verify argument being set to True. From the documentation for that option in the file.managed function:

If True, hash verification of remote file sources (http://, https://, ftp://) will be skipped, and the source_hash argument will be ignored.

@garethgreenaway garethgreenaway added Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged and removed Bug broken, incorrect, or confusing behavior needs-triage labels Dec 21, 2020
@garethgreenaway garethgreenaway added this to the Blocked milestone Dec 21, 2020
@garethgreenaway
Copy link
Contributor

Closing this due to age and the old version of Salt.
Can you retest this with the latest release of Salt 3006.2 and if this is still an issue, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged
Projects
None yet
Development

No branches or pull requests

3 participants