Преглед изворни кода

Merge branch 'master' of git.elektrat.de:mcnesium/matrix-docker-ansible-deploy

pull/2959/head
mcnesium пре 3 година
родитељ
комит
8f8f149d68
No known key found for this signature in database GPG Key ID: 7D6CC73E428F633F
2 измењених фајлова са 40 додато и 0 уклоњено
  1. +3
    -0
      ansible.cfg
  2. +37
    -0
      inventory/scripts/update.sh

+ 3
- 0
ansible.cfg Прегледај датотеку

@@ -1,6 +1,9 @@
[defaults]
retry_files_enabled = False
stdout_callback = yaml
display_failed_stderr = True
display_skipped_hosts = False
nocows = True

[connection]
pipelining = True

+ 37
- 0
inventory/scripts/update.sh Прегледај датотеку

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# Wrapper script for the entire update procedure including
# * updating git repo
# * downloading roles
# * running playbook
#
# This script first asks for the passwords for all the hosts and then pipes them
# to the ansible playbook wrapper script, so that we don't need to wait for the
# merging and downloading to finish, before being asked for the passwords.
#

# exit on errors
set -e

# set playbook root path
root=$(dirname "$(readlink -f "$0")")/../..

# capture passwords for all hosts
for host in "$root"/inventory/*.yml; do
read -rp "sudo password for $(basename "$host"): " -s pw
pipeinput+="$pw\n"
echo
done

# merge upstream master branch
git -C "$root" pull upstream master

# check the changelog before updating
less CHANGELOG.md
read -r

# download upstream roles
make -f "$root"/Makefile roles

# run ansible-playbook on all hosts
echo -e "$pipeinput" | bash "$root"/inventory/scripts/ansible-all-hosts.sh

Loading…
Откажи
Сачувај