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

Less an issue -- more a question #40

Open
jdkelleher opened this issue Apr 27, 2019 · 2 comments
Open

Less an issue -- more a question #40

jdkelleher opened this issue Apr 27, 2019 · 2 comments

Comments

@jdkelleher
Copy link
Contributor

jdkelleher commented Apr 27, 2019

Why have update and upgrade only run when sources.list or sources.list.d are changed?

This means it can't be run as a maintenance job. I'm new to Saltstack formulas, so am I missing something obvious?

I modified and tested the formula to use additional pillar data, "always_update" and "always_upgrade" to enable the maintenance behavior, e.g.

{% from "apt/map.jinja" import apt as apt_map with context %}
{% set apt = pillar.get('apt', {}) %}
{% set always_update = apt.get('always_update', apt_map.always_update) %}

apt-get -y update:
  {% if always_update %}
  cmd.run
  {% else %}
  cmd.wait:
    - watch:
      - file: /etc/apt/sources.list
      - file: /etc/apt/sources.list.d
  {% endif %}

Any interesting in a pull request?

@daks
Copy link
Member

daks commented Apr 28, 2019

Looking at the README  I see there are two states apt.update and apt.upgrade so you should be able to just run those and have and update/upgrade, did you tried this?

@jdkelleher
Copy link
Contributor Author

Looking at the README  I see there are two states apt.update and apt.upgrade so you should be able to just run those and have and update/upgrade, did you tried this?

Tried that as shown below....

kelleher@buffet:~$ sudo salt 'vsi02' state.apply apt.update
vsi02:
----------
          ID: apt-get update
    Function: cmd.wait
      Result: False
     Comment: The following requisites were not found:
                                 watch:
                                     file: /etc/apt/sources.list
                                     file: /etc/apt/sources.list.d
     Started: 14:31:56.468828
    Duration: 0.043 ms
     Changes:   

Summary for vsi02
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   0.043 ms
ERROR: Minions returned with non-zero exit code
kelleher@buffet:~$ 

This aligns with a commit on 2016-04-23, but not sure why the change was made - 7c7cd9f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants