salt icon indicating copy to clipboard operation
salt copied to clipboard

how to force salt-cloud to keep salt-minion/salt-common on an older version

Open ksmitdevops opened this issue 9 years ago • 4 comments

Description of Issue/Question

We use salt-cloud for vmware provisioning. We've experienced a number of issues with 2016.11 version, and so we want to keep salt-minion & salt-common on version 2016.3.4 until we can verify that the latest version no longer has debilitating bugs in our environment. When we use salt-cloud to provision, we're finding that it tries to upgrade the version already installed in our template from 2016.3.4 to 2016.11. To try to circumvent this, we've use apt pinning to force the version to remain 2016.3.4 as well as apt holding (eg. echo salt-minion hold | dpkg --set-selections; echo salt-common hold | dpkg --set-selections), but salt-cloud fails with the following error

The following packages have unmet dependencies:
 salt-minion : Depends: salt-common (= 2016.11.1+ds-1) but 2016.3.4+ds-1 is to be installed
E: Unable to correct problems, you have held broken packages.
 * ERROR: Failed to run install_debian_8_stable()!!!
[DEBUG   ] Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 salt-minion : Depends: salt-common (= 2016.11.1+ds-1) but 2016.3.4+ds-1 is to be installed
E: Unable to correct problems, you have held broken packages.
 * ERROR: Failed to run install_debian_8_stable()!!!

Is there a proper way to accomplish what we are trying to do?

Setup

Repo config in our template (this gets overwritten by salt-cloud to use the latest repo, instead of 2016.3):

deb http://repo.saltstack.com/apt/debian/8/amd64/2016.3 jessie main

Held packages:

dpkg --get-selections | grep salt
salt-common					hold
salt-minion					hold

salt-cloud profile config:

web_preprod:
  provider:       vmware_provider
  clonefrom:      jessie_webs
  num_cpus:       1
  memory:         1GB
  resourcepool:   Pre-Prod
  cluster:        Pre-Prod
  datastore:      DS01
  network:
    Network adapter 1:
      adapter_type: vmxnet3
      switch_type:  standard
  folder:         web_project
  domain:         fqdn
  template:       False
  power_on:       True
  deploy:         True
  ssh_username:   root
  password:       [munged]
  minion:
    master:         salt-master01.fqdn
    startup_states: sls
    sls_list:
      - cloud.provision

Steps to Reproduce Issue

salt-cloud -p web_preprod web03-staging -l debug
...
...
Reading package lists...
Building dependency tree...
Reading state information...
pciutils is already the newest version.
procps is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
 *  INFO: Running config_salt()
 *  INFO: Running install_debian_8_stable()
Reading package lists...
Building dependency tree...[DEBUG   ] Reading package lists...
Building dependency tree...
Reading state information...
pciutils is already the newest version.
procps is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
 *  INFO: Running config_salt()
 *  INFO: Running install_debian_8_stable()
Reading package lists...
Building dependency tree...
Connection to 10.10.10.137 closed.
[DEBUG   ] Connection to 10.10.10.137 closed.

Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 salt-minion : Depends: salt-common (= 2016.11.1+ds-1) but 2016.3.4+ds-1 is to be installed
E: Unable to correct problems, you have held broken packages.
 * ERROR: Failed to run install_debian_8_stable()!!!
[DEBUG   ] Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 salt-minion : Depends: salt-common (= 2016.11.1+ds-1) but 2016.3.4+ds-1 is to be installed
E: Unable to correct problems, you have held broken packages.
 * ERROR: Failed to run install_debian_8_stable()!!!
Error: There was a profile error: Command 'ssh -t -t -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oControlPath=none -p 22 [email protected] '/tmp/.saltcloud-5801de0e-444e-4661-8e29-a04b51e73d6c/deploy.sh -c '"'"'/tmp/.saltcloud-5801de0e-444e-4661-8e29-a04b51e73d6c'"'"''' failed. Exit code: 1

Versions Report

salt-cloud --versions-report
Salt Version:
            Salt: 2016.3.4
 
Dependency Versions:
 Apache Libcloud: Not Installed
            cffi: 1.1.2
        cherrypy: 3.7.0
        dateutil: Not Installed
           gitdb: Not Installed
       gitpython: Not Installed
           ioflo: Not Installed
          Jinja2: 2.8
         libgit2: Not Installed
         libnacl: Not Installed
        M2Crypto: 0.22
            Mako: Not Installed
    msgpack-pure: Not Installed
  msgpack-python: 0.4.8
    mysql-python: Not Installed
       pycparser: 2.14
        pycrypto: 2.6.1
          pygit2: Not Installed
          Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
    python-gnupg: Not Installed
          PyYAML: 3.12
           PyZMQ: 16.0.1
            RAET: Not Installed
           smmap: Not Installed
         timelib: Not Installed
         Tornado: 4.4.2
             ZMQ: 4.1.5
 
System Versions:
            dist: debian 7.11 
         machine: x86_64
         release: 3.2.0-4-amd64
          system: Linux
         version: debian 7.11 

ksmitdevops avatar Dec 15 '16 22:12 ksmitdevops

what seems to have worked for us was to make our /etc/apt/sources.list.d/saltstack.list file immutable, and therefore un-writeable by salt-cloud.

would still like to know if there is a more preferred way of accomplishing this.

ksmitdevops avatar Dec 16 '16 01:12 ksmitdevops

@schlagify all you need to add in your profile config is script_args: 'git v2016.3.4' and that will install version 2016.3.4 on creation of the salt minion from salt-cloud. does that work as a solution for you?

Ch3LL avatar Dec 16 '16 19:12 Ch3LL

@Ch3LL yes, that sounds good. i will give that a try and will update this issue w/the results. thank you!

ksmitdevops avatar Dec 16 '16 20:12 ksmitdevops

@Ch3LL so it looks like that changes the installation method from apt to git, which increases the provisioning time in our environment (and thus isn't a good solution). since i have a working solution, i'm just going to close this out. cheers

ksmitdevops avatar Dec 16 '16 20:12 ksmitdevops