salt-bootstrap icon indicating copy to clipboard operation
salt-bootstrap copied to clipboard

[BUG] Bootstrap script doesn't enforce version argument.

Open grzegorz-gn opened this issue 2 years ago • 2 comments

./bootstrap-salt.sh -v ./bootstrap-salt.sh -- Version 2023.07.25

SALT installation curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io

chmod +x bootstrap-salt.sh

./bootstrap-salt.sh stable

  • INFO: Running version: 2023.07.25

  • INFO: Executed by: /bin/sh

  • INFO: Command line: './bootstrap-salt.sh stable'

  • WARN: Running the unstable version of bootstrap-salt.sh

  • INFO: System Information:

  • INFO: CPU: GenuineIntel

  • INFO: CPU Arch: x86_64

  • INFO: OS Name: Linux

  • INFO: OS Version: 5.14.0-284.11.1.el9_2.x86_64

  • INFO: Distribution: AlmaLinux 9.2

Expected result: It should install the specified version - stable

grzegorz-gn avatar Aug 24 '23 12:08 grzegorz-gn

Just tried sh bootstrap-salt.sh onedir 3006.3 on a CentOS box and it finished up with no errors, but it installed 3006.1 from the yum repo and not 3006.3 using the onedir install as I specified.

darkpixel avatar Sep 28 '23 15:09 darkpixel

Just tried sh bootstrap-salt.sh onedir 3006.3 on a CentOS box and it finished up with no errors, but it installed 3006.1 from the yum repo and not 3006.3 using the onedir install as I specified.

On AlmaLinux 9.2 it is always latest version. Tested also on 3006.6 version.

grzegorz-gn avatar Feb 08 '24 17:02 grzegorz-gn

I'm seeing the same thing on Ubuntu 22.04.3 LTS.

gnu-lorien avatar Dec 04 '24 01:12 gnu-lorien

@grzegorz-gn Please retry with the latest v2024.12.09, minor versions are supported correctly now.

dmurphy18 avatar Dec 09 '24 23:12 dmurphy18

@grzegorz-gn Here is the latest output from using the bootstrap-salt.sh script

david@david-XPS-15-9570:~/Downloads$ bash ./bootstrap-salt.sh --version

 * ERROR: Option does not exist : -

  Usage :  bootstrap-salt.sh [options] <install-type> [install-type-args]

  Installation types:
    - stable               Install latest stable release. This is the default
                           install type
    - stable [branch]      Install latest version on a branch. Only supported
                           for packages available at packages.broadcom.com
    - stable [version]     Install a specific version. Only supported for
                           packages available at packages.broadcom.com
                           To pin a 3xxx minor version, specify it as 3xxx.0
    - testing              RHEL-family specific: configure EPEL testing repo
    - git                  Install from the head of the master branch
    - git [ref]            Install from any git ref (such as a branch, tag, or
                           commit)
    - onedir               Install latest onedir release.
    - onedir [version]     Install a specific version. Only supported for
                           onedir packages available at packages.broadcom.com

    - onedir_rc            Install latest onedir RC release.
    - onedir_rc [version]  Install a specific version. Only supported for
                           onedir RC packages available at packages.broadcom.com

  Examples:
    - bootstrap-salt.sh
    - bootstrap-salt.sh stable
    - bootstrap-salt.sh stable 3006
    - bootstrap-salt.sh stable 3006.1
    - bootstrap-salt.sh testing
    - bootstrap-salt.sh git
    - bootstrap-salt.sh git 3006.7
    - bootstrap-salt.sh git v3006.8
    - bootstrap-salt.sh git 3007.1
    - bootstrap-salt.sh git v3007.1
    - bootstrap-salt.sh git 06f249901a2e2f1ed310d58ea3921a129f214358
    - bootstrap-salt.sh onedir
    - bootstrap-salt.sh onedir 3006
    - bootstrap-salt.sh onedir_rc
    - bootstrap-salt.sh onedir_rc 3008


  Options:
    -a  Pip install all Python pkg dependencies for Salt. Requires -V to install
        all pip pkgs into the virtualenv.
        (Only available for Ubuntu based distributions)
    -A  Pass the salt-master DNS name or IP. This will be stored under
        ${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf
    -b  Assume that dependencies are already installed and software sources are
        set up. If git is selected, git tree is still checked out as dependency
        step.
    -c  Temporary configuration directory
    -C  Only run the configuration function. Implies -F (forced overwrite).
        To overwrite Master, Syndic or Api configs, -M,-S or -W, respectively, must
        also be specified. Salt installation will be ommitted, but some of the
        dependencies could be installed to write configuration with -j or -J.
    -d  Disables checking if Salt services are enabled to start on system boot.
        You can also do this by touching /tmp/disable_salt_checks on the target
        host. Default: ${BS_FALSE}
    -D  Show debug output
    -f  Force shallow cloning for git installations.
        This may result in an "n/a" in the version number.
    -F  Allow copied files to overwrite existing (config, init.d, etc)
    -g  Salt Git repository URL. Default: https://github.com/saltstack/salt.git
    -h  Display this message
    -H  Use the specified HTTP proxy for all download URLs (including https://).
        For example: http://myproxy.example.com:3128
    -i  Pass the salt-minion id. This will be stored under
        ${BS_SALT_ETC_DIR}/minion_id
    -I  If set, allow insecure connections while downloading any files. For
        example, pass '--no-check-certificate' to 'wget' or '--insecure' to
        'curl'. On Debian and Ubuntu, using this option with -U allows obtaining
        GnuPG archive keys insecurely if distro has changed release signatures.
    -j  Replace the Minion config file with data passed in as a JSON string. If
        a Minion config file is found, a reasonable effort will be made to save
        the file with a ".bak" extension. If used in conjunction with -C or -F,
        no ".bak" file will be created as either of those options will force
        a complete overwrite of the file.
    -J  Replace the Master config file with data passed in as a JSON string. If
        a Master config file is found, a reasonable effort will be made to save
        the file with a ".bak" extension. If used in conjunction with -C or -F,
        no ".bak" file will be created as either of those options will force
        a complete overwrite of the file.
    -k  Temporary directory holding the minion keys which will pre-seed
        the master.
    -K  If set, keep the temporary files in the temporary directories specified
        with -c and -k
    -l  Disable ssl checks. When passed, switches "https" calls to "http" where
        possible.
    -L  Also install salt-cloud and required python-libcloud package
    -M  Also install salt-master
    -n  No colours
    -N  Do not install salt-minion
    -p  Extra-package to install while installing Salt dependencies. One package
        per -p flag. You are responsible for providing the proper package name.
    -P  Allow pip based installations. On some distributions the required salt
        packages or its dependencies are not available as a package for that
        distribution. Using this flag allows the script to use pip as a last
        resort method. NOTE: This only works for functions which actually
        implement pip based installations.
    -q  Quiet salt installation from git (setup.py install -q)
    -Q  Quickstart, install the Salt master and the Salt minion.
        And automatically accept the minion key.
    -R  Specify a custom repository URL. Assumes the custom repository URL
        points to a repository that mirrors Salt packages located at
        packages.broadcom.com. The option passed with -R replaces the
        "packages.broadcom.com". If -R is passed, -r is also set. Currently only
        works on CentOS/RHEL and Debian based distributions and macOS.
    -s  Sleep time used when waiting for daemons to start, restart and when
        checking for the services running. Default: 3
    -S  Also install salt-syndic
    -r  Disable all repository configuration performed by this script. This
        option assumes all necessary repository configuration is already present
        on the system.
    -U  If set, fully upgrade the system prior to bootstrapping Salt
    -v  Display script version
    -V  Install Salt into virtualenv
        (only available for Ubuntu based distributions)
    -W  Also install salt-api
    -x  Changes the Python version used to install Salt (default: Python 3).
        Python 2.7 is no longer supported.
    -X  Do not start daemons after installation

david@david-XPS-15-9570:~/Downloads$ bash ./bootstrap-salt.sh -v
./bootstrap-salt.sh -- Version 2024.12.12
david@david-XPS-15-9570:~/Downloads$

And from examining the script, I don't see any support for the command line you typed. ./bootstrap-salt.sh -- Version 2023.07.25

Improper arguments supplied and defaulting to installing latest, appears to be functioning correctly

Closing this issue, but feel free to re-open if you have further operation.

Btw: what would 2023.07.25 refer to , no released version of Salt, 3006.x and up are only currently supported versions.

dmurphy18 avatar Dec 12 '24 20:12 dmurphy18