saltstack / salt-bootstrap

Generic Salt Bootstrap Script
Other
927 stars 546 forks source link

Salt bootstrap upgrades to Flourine instead of provided Oxygen patch version #1326

Closed dwickwire closed 5 years ago

dwickwire commented 5 years ago

Description of Issue/Question

There appears to be a bug in the bootstrap code. Salt upgrades to Flourine rather than the patch level 2018.3.4!

wget -O install_salt.sh https://bootstrap.saltstack.com

# installs 2019.2.0!
sudo sh install_salt.sh -P -F -U stable 2018.3.4

Setup

Existing install on 2018.3.3

Steps to Reproduce Issue

vagrant@deployments:~$ wget -O install_salt.sh https://bootstrap.saltstack.com
--2019-02-27 15:16:12--  https://bootstrap.saltstack.com/
Resolving bootstrap.saltstack.com (bootstrap.saltstack.com)... 138.197.226.47, 2604:a880:400:d0::2:e001
Connecting to bootstrap.saltstack.com (bootstrap.saltstack.com)|138.197.226.47|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://bootstrap.saltstack.com/stable/bootstrap-salt.sh [following]
--2019-02-27 15:16:13--  https://bootstrap.saltstack.com/stable/bootstrap-salt.sh
Reusing existing connection to bootstrap.saltstack.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 264955 (259K) [application/x-sh]
Saving to: ‘install_salt.sh’

install_salt.sh                                    100%[================================================================================================================>] 258.75K   222KB/s    in 1.2s    

2019-02-27 15:16:14 (222 KB/s) - ‘install_salt.sh’ saved [264955/264955]

vagrant@deployments:~$ sudo salt-call --version
salt-call 2018.3.3 (Oxygen)
vagrant@deployments:~$ sudo sh install_salt.sh -P -F -U stable 2018.3.4
 *  INFO: Running version: 2019.01.08
 *  INFO: Executed by: shell pipe
 *  INFO: Command line: 'install_salt.sh -P -F -U stable 2018.3.4'

 *  INFO: System Information:
 *  INFO:   CPU:          GenuineIntel
 *  INFO:   CPU Arch:     x86_64
 *  INFO:   OS Name:      Linux
 *  INFO:   OS Version:   4.15.0-45-generic
 *  INFO:   Distribution: Ubuntu 18.04

 *  INFO: Installing minion
 *  INFO: Found function install_ubuntu_stable_deps
 *  INFO: Found function config_salt
 *  INFO: Found function preseed_master
 *  INFO: Found function install_ubuntu_stable
 *  INFO: Found function install_ubuntu_stable_post
 *  INFO: Found function install_ubuntu_restart_daemons
 *  INFO: Found function daemons_running
 *  INFO: Found function install_ubuntu_check_services
 *  INFO: Running install_ubuntu_stable_deps()
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:4 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic InRelease
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/main Sources [76.4 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main Sources [249 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [270 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [531 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [126 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [738 kB]
Fetched 2,243 kB in 5s (482 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  base-files grub-common grub-pc grub-pc-bin grub2-common landscape-common
  libpci3 libssl1.0.0 libx11-6 libx11-data pciutils salt-api salt-common
  salt-master salt-minion
15 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.0 MB of archives.
After this operation, 1,968 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 base-files amd64 10.1ubuntu2.4 [60.2 kB]
Get:2 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic/main amd64 salt-minion all 2019.2.0+ds-1 [27.9 kB]
Get:3 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic/main amd64 salt-master all 2019.2.0+ds-1 [40.9 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 pciutils amd64 1:3.5.2-1ubuntu1.1 [257 kB]
Get:5 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic/main amd64 salt-common all 2019.2.0+ds-1 [6,333 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpci3 amd64 1:3.5.2-1ubuntu1.1 [24.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.0.0 amd64 1.0.2n-1ubuntu5.3 [1,088 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libx11-data all 2:1.6.4-3ubuntu0.2 [113 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libx11-6 amd64 2:1.6.4-3ubuntu0.2 [569 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub-pc amd64 2.02-2ubuntu8.12 [137 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub2-common amd64 2.02-2ubuntu8.12 [532 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub-pc-bin amd64 2.02-2ubuntu8.12 [900 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub-common amd64 2.02-2ubuntu8.12 [1,772 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 landscape-common amd64 18.01-0ubuntu3.2 [85.5 kB]
Get:15 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic/main amd64 salt-api all 2019.2.0+ds-1 [13.0 kB]
Preconfiguring packages ...
Fetched 12.0 MB in 11s (1,040 kB/s)
(Reading database ... 106748 files and directories currently installed.)
Preparing to unpack .../base-files_10.1ubuntu2.4_amd64.deb ...
Warning: Stopping motd-news.service, but it can still be activated by:
  motd-news.timer
Unpacking base-files (10.1ubuntu2.4) over (10.1ubuntu2.3) ...
Setting up base-files (10.1ubuntu2.4) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
motd-news.service is a disabled or a static unit, not starting it.
(Reading database ... 106748 files and directories currently installed.)
Preparing to unpack .../00-pciutils_1%3a3.5.2-1ubuntu1.1_amd64.deb ...
Unpacking pciutils (1:3.5.2-1ubuntu1.1) over (1:3.5.2-1ubuntu1) ...
Preparing to unpack .../01-libpci3_1%3a3.5.2-1ubuntu1.1_amd64.deb ...
Unpacking libpci3:amd64 (1:3.5.2-1ubuntu1.1) over (1:3.5.2-1ubuntu1) ...
Preparing to unpack .../02-libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb ...
Unpacking libssl1.0.0:amd64 (1.0.2n-1ubuntu5.3) over (1.0.2n-1ubuntu5.2) ...
Preparing to unpack .../03-libx11-data_2%3a1.6.4-3ubuntu0.2_all.deb ...
Unpacking libx11-data (2:1.6.4-3ubuntu0.2) over (2:1.6.4-3ubuntu0.1) ...
Preparing to unpack .../04-libx11-6_2%3a1.6.4-3ubuntu0.2_amd64.deb ...
Unpacking libx11-6:amd64 (2:1.6.4-3ubuntu0.2) over (2:1.6.4-3ubuntu0.1) ...
Preparing to unpack .../05-grub-pc_2.02-2ubuntu8.12_amd64.deb ...
Unpacking grub-pc (2.02-2ubuntu8.12) over (2.02-2ubuntu8.10) ...
Preparing to unpack .../06-grub2-common_2.02-2ubuntu8.12_amd64.deb ...
Unpacking grub2-common (2.02-2ubuntu8.12) over (2.02-2ubuntu8.10) ...
Preparing to unpack .../07-grub-pc-bin_2.02-2ubuntu8.12_amd64.deb ...
Unpacking grub-pc-bin (2.02-2ubuntu8.12) over (2.02-2ubuntu8.10) ...
Preparing to unpack .../08-grub-common_2.02-2ubuntu8.12_amd64.deb ...
Unpacking grub-common (2.02-2ubuntu8.12) over (2.02-2ubuntu8.10) ...
Preparing to unpack .../09-landscape-common_18.01-0ubuntu3.2_amd64.deb ...
Unpacking landscape-common (18.01-0ubuntu3.2) over (18.01-0ubuntu3.1) ...
Preparing to unpack .../10-salt-minion_2019.2.0+ds-1_all.deb ...
Unpacking salt-minion (2019.2.0+ds-1) over (2018.3.3+ds-2) ...
Preparing to unpack .../11-salt-master_2019.2.0+ds-1_all.deb ...
Unpacking salt-master (2019.2.0+ds-1) over (2018.3.3+ds-2) ...
Preparing to unpack .../12-salt-common_2019.2.0+ds-1_all.deb ...
Unpacking salt-common (2019.2.0+ds-1) over (2018.3.3+ds-2) ...
Preparing to unpack .../13-salt-api_2019.2.0+ds-1_all.deb ...
Unpacking salt-api (2019.2.0+ds-1) over (2018.3.3+ds-2) ...
Setting up libssl1.0.0:amd64 (1.0.2n-1ubuntu5.3) ...
Setting up landscape-common (18.01-0ubuntu3.2) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for plymouth-theme-ubuntu-text (0.9.3-1ubuntu7.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up grub-common (2.02-2ubuntu8.12) ...
Installing new version of config file /etc/grub.d/00_header ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Processing triggers for systemd (237-3ubuntu10.13) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up libpci3:amd64 (1:3.5.2-1ubuntu1.1) ...
Setting up salt-common (2019.2.0+ds-1) ...
Setting up libx11-data (2:1.6.4-3ubuntu0.2) ...
Setting up grub-pc-bin (2.02-2ubuntu8.12) ...
Setting up libx11-6:amd64 (2:1.6.4-3ubuntu0.2) ...
Setting up grub2-common (2.02-2ubuntu8.12) ...
Setting up salt-master (2019.2.0+ds-1) ...

Configuration file '/etc/salt/master'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Using current old file as you requested.
Setting up pciutils (1:3.5.2-1ubuntu1.1) ...
Setting up salt-minion (2019.2.0+ds-1) ...

Configuration file '/etc/salt/minion'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Using current old file as you requested.
Installing new version of config file /etc/salt/proxy ...
Setting up salt-api (2019.2.0+ds-1) ...
Setting up grub-pc (2.02-2ubuntu8.12) ...
Installing for i386-pc platform.
Installation finished. No error reported.
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-45-generic
Found initrd image: /boot/initrd.img-4.15.0-45-generic
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
done
Processing triggers for initramfs-tools (0.130ubuntu3.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Reading package lists...
Building dependency tree...
Reading state information...
ca-certificates is already the newest version (20180409).
dirmngr is already the newest version (2.2.4-1ubuntu1.2).
gnupg is already the newest version (2.2.4-1ubuntu1.2).
apt-transport-https is already the newest version (1.6.8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.H9vqL57edN/gpg.1.sh --keyserver-options ca-cert-file=/etc/ssl/certs/ca-certificates.crt --fetch-keys https://repo.saltstack.com/apt/ubuntu/18.04/amd64/archive/2018.3.4/SALTSTACK-GPG-KEY.pub
gpg: keyserver option 'ca-cert-file' is obsolete; please use 'hkp-cacert' in dirmngr.conf
gpg: requesting key from 'https://repo.saltstack.com/apt/ubuntu/18.04/amd64/archive/2018.3.4/SALTSTACK-GPG-KEY.pub'
gpg: key 0E08A149DE57BFBE: "SaltStack Packaging Team <packaging@saltstack.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/archive/2018.3.4 bionic InRelease [2,126 B]
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:6 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/archive/2018.3.4 bionic/main amd64 Packages [3,338 B]
Fetched 5,464 B in 1s (5,236 B/s)
Reading package lists...
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/archive/2018.3.4 bionic InRelease
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 74.6 kB in 17s (4,313 B/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
python-yaml is already the newest version (3.12-1build2).
pciutils is already the newest version (1:3.5.2-1ubuntu1.1).
procps is already the newest version (2:3.3.12-3ubuntu1.1).
python-apt is already the newest version (1.6.3ubuntu1).
python-requests is already the newest version (2.18.4-2ubuntu0.1).
python2.7 is already the newest version (2.7.15~rc1-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 *  INFO: Running install_ubuntu_stable()
Reading package lists...
Building dependency tree...
Reading state information...
salt-minion is already the newest version (2019.2.0+ds-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 *  INFO: Running install_ubuntu_stable_post()
 *  INFO: Running install_ubuntu_check_services()
 *  INFO: Running install_ubuntu_restart_daemons()
 *  INFO: Running daemons_running()
 *  INFO: Salt installed!
vagrant@deployments:~$ sudo salt-call --version
salt-call 2019.2.0 (Fluorine)

Versions Report

vagrant@deployments:~$ salt --versions-report
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.27.0
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-45-generic
         system: Linux
        version: Ubuntu 18.04 bionic
dafyddj commented 5 years ago

Are you saying Salt was installed before running the bootstrap script?

Edit: don't use -U to fully upgrade the system before the script tries to install Salt

dwickwire commented 5 years ago

Yes, salt was installed already. Its in the diff above after the wget, note:

vagrant@deployments:~$ sudo salt-call --version
salt-call 2018.3.3 (Oxygen)
vagrant@deployments:~$ sudo sh install_salt.sh -P -F -U stable 2018.3.4
... 
vagrant@deployments:~$ sudo salt-call --version
salt-call 2019.2.0 (Fluorine)
dafyddj commented 5 years ago

My answer remains the same: don't use -U to fully upgrade the system before the script gets a chance to install 2018.3.4.

Edit: your apt source is initially pointing at the latest release:

Hit:4 https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic InRelease
dwickwire commented 5 years ago

Whoops! Good to know, thanks for the clarification.