Update salt from 2015.5.3 to 2016.3.2

Posted by clsung on Wednesday, August 24, 2016

When reading salt’s source code, it seems we have a ‘source_hash_update’ option on “archive.extracted”, however when I added so, salt complains:

Warnings: 'source_hash_update', 'group' and 'user' are invalid keyword
              arguments for 'archive.extracted'. If you were trying to pass
              additional data to be used in a template context, please populate
              'context' with 'key: value' pairs. Your approach will work until
              Salt Carbon is out. Please update your state files.

Let’s see the current output.

# salt-run manage.versions
Master:
    2016.3.2
Minion requires update:
    ----------
    cl-jenkins:
        2015.5.3
    ip-172-31-49-237.ec2.internal:
        2015.5.3
    redis-devel2:
        2015.5.3

So let’s update the minions to 2016.3.2, I’ve put /srv/salt/upgrade_salt/init.sls as following:

fetch_install_salt_script:
 cmd.run:
 - name: curl -L https://bootstrap.saltstack.com -o install_salt.sh

update_minion:
 cmd.run:
 - name: sh install_salt.sh -P

And execute it, however I found all my minions are gone. After investigation, the problem is there’s an invalid keyword in /etc/salt/minion:

2016-xx-yy 03:25:42,516 [salt.minion      ][ERROR   ][4724] Invalid keyword 'standard' for variable 'master_type'

Therefore I need to replace ‘standard’ with ‘str’ to fix it. (Remember to restart the salt-minion service.)

# salt-run manage.versions
Master:
    2016.3.2
Up to date:
    ----------
    cl-jenkins:
        2016.3.2
    ip-172-31-49-237.ec2.internal:
        2016.3.2
    redis-devel2:
        2016.3.2