You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

Upgrade ansible (#10190) * project: update all dependencies including ansible Upgrade to ansible 7.x and ansible-core 2.14.x. There seems to be issue with ansible 8/ansible-core 2.15 so we remain on those versions for now. It's quite a big bump already anyway. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * tests: install aws galaxy collection Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * ansible-lint: disable various rules after ansible upgrade Temporarily disable a bunch of linting action following ansible upgrade. Those should be taken care of separately. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve deprecated-module ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve no-free-form ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[meta] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[playbook] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[tasks] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve risky-file-permissions ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve risky-shell-pipe ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: remove deprecated warn args Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: use fqcn for non builtin tasks Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve syntax-check[missing-file] for contrib playbook Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: use arithmetic inside jinja to fix ansible 6 upgrade Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
1 year ago
  1. # use virtualenv to install all python requirements
  2. VENVDIR=venv
  3. python3 -m venv $VENVDIR
  4. source $VENVDIR/bin/activate
  5. pip install --upgrade pip
  6. pip install wheel
  7. pip install --upgrade setuptools
  8. pip install -r requirements.txt
  9. pip install -r tests/requirements.txt
  10. ansible-galaxy install -r tests/requirements.yml
  11. pre-commit install
  12. # prepare an inventory to test with
  13. INV=inventory/lab
  14. rm -rf ${INV}.bak &> /dev/null
  15. mv ${INV} ${INV}.bak &> /dev/null
  16. cp -a inventory/sample ${INV}
  17. rm -f ${INV}/hosts.ini
  18. # customize the vagrant environment
  19. mkdir vagrant
  20. cat << EOF > vagrant/config.rb
  21. \$instance_name_prefix = kub"
  22. \$vm_cpus = 2
  23. \$num_instances = 3
  24. \$os = "almalinux8"
  25. \$subnet = "192.168.56"
  26. \$network_plugin = "calico"
  27. \$inventory = "$INV"
  28. \$shared_folders = { 'temp/docker_rpms' => "/var/cache/yum/x86_64/7/docker-ce/packages" }
  29. EOF
  30. # make the rpm cache
  31. mkdir -p temp/docker_rpms
  32. vagrant up
  33. # make a copy of the downloaded docker rpm, to speed up the next provisioning run
  34. scp kub-1:/var/cache/yum/x86_64/7/docker-ce/packages/* temp/docker_rpms/
  35. # copy kubectl access configuration in place
  36. mkdir $HOME/.kube/ &> /dev/null
  37. ln -s $PWD/$INV/artifacts/admin.conf $HOME/.kube/config
  38. # make the kubectl binary available
  39. sudo ln -s $PWD/$INV/artifacts/kubectl /usr/local/bin/kubectl
  40. #or
  41. export PATH=$PATH:$PWD/$INV/artifacts