Grains refresh/reload failed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
I'm trying to reload the minion grains during a sls run with no success.
I have tried to use:
- reload_grains: True
- saltutil.grains_refresh
- salt service.running restart (using the watch statement)
Using each of the above function I failed to reload the grains during the state run.
Consider the following example:
before:
cmd.run:
- name: echo "{{ grains['dns'] }}"
echo "domain test" >> /etc/resolv.conf:
cmd.run: []
after:
cmd.run:
- name: echo "{{ grains['dns'] }}"
At the before id I expect the domain field to be empty while on the after id I expect that the domain field would containtest
Another example, when i file.managed the grains.conf file I want that the grains change will take affect on the current run.
How can I achieve that?
I'm running on Ubuntu 16.04 with salt-minion and salt-master version 3000.3
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.
Research direction
Start by tracing how grains are loaded during cmd.run state execution, then compare the behavior of reload_grains, saltutil.grains_refresh, service.running, and file.managed. Verify whether changes to /etc/resolv.conf or grains.conf can affect later states in the same run, and define done as the after state observing the updated grain value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100