FAQ
Hi,

I have a problem where a binary file is being replaced on every single
highstate run. Here's the output at the end of the highstate:
----------
           ID: logstash_tarball
     Function: file.managed
         Name: /opt/logstash.tar.gz
       Result: True
      Comment: File /opt/logstash.tar.gz updated
      Changes:
               ----------
               diff:
                   Replace binary file

Here the is the .sls file rule:
logstash_tarball:
   file.managed:
     - name: /opt/logstash.tar.gz
     - user: root
     - group: root
     - mode: 0755
     - source: salt://files/logstash/logstash.tar.gz

I am currently running salt 2014.1.7 (from epel6) on both sides and I don't
remember 2014.1.5 acting this way. However, maybe it was. This system is
Amazon Linux. Why is it replacing the file when it hasn't changed? Also, I
noticed that the salt highstate runs appear to download the file every
time. Is there a way to prevent that?

Thanks,
wt

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Leonīds Maslovs at Jul 30, 2014 at 7:33 am
    Hi Warren,

    See
    http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.managed,
    particularly source_hash attribute.

    e.g.
    tomdroid-src-0.7.3.tar.gz:
       file.managed:
         - name: /tmp/tomdroid-src-0.7.3.tar.gz
         - source:
    https://launchpad.net/tomdroid/beta/0.7.3/+download/tomdroid-src-0.7.3.tar.gz
         - source_hash:
    https://launchpad.net/tomdroid/beta/0.7.3/+download/tomdroid-src-0.7.3.tar.gz/+md5

    Please note source_hash can be the url OR hash string value, e.g.
    x-postgresql-jdbc-libs:
       file.managed:
         - name: {{ tomcat.full_path }}/lib/postgresql-9.3-1101.jdbc4.jar
         - source:
    http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc4.jar
         - source_hash: md5=993d30f1d19e9e170e558b9efa130d46
         - user: root
         - group: root
         - mode: 644
         - require:
           - archive: apache-tomcat-common-archive
         - watch_in:
           - service: x-service

    Does it solve you problem?

    On Tuesday, July 29, 2014 9:07:14 PM UTC+3, Warren Turkal wrote:

    Hi,

    I have a problem where a binary file is being replaced on every single
    highstate run. Here's the output at the end of the highstate:
    ----------
    ID: logstash_tarball
    Function: file.managed
    Name: /opt/logstash.tar.gz
    Result: True
    Comment: File /opt/logstash.tar.gz updated
    Changes:
    ----------
    diff:
    Replace binary file

    Here the is the .sls file rule:
    logstash_tarball:
    file.managed:
    - name: /opt/logstash.tar.gz
    - user: root
    - group: root
    - mode: 0755
    - source: salt://files/logstash/logstash.tar.gz

    I am currently running salt 2014.1.7 (from epel6) on both sides and I
    don't remember 2014.1.5 acting this way. However, maybe it was. This system
    is Amazon Linux. Why is it replacing the file when it hasn't changed? Also,
    I noticed that the salt highstate runs appear to download the file every
    time. Is there a way to prevent that?

    Thanks,
    wt
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJul 29, '14 at 6:07p
activeJul 30, '14 at 7:33a
posts2
users2

2 users in discussion

Warren Turkal: 1 post Leonīds Maslovs: 1 post

People

Translate

site design / logo © 2022 Grokbase