LINUX.ORG.RU

puppet ssh command exit code 1

 ,


0

2

Добрый вечер.
puppet --version
3.8.6
Запускаю через ssh команду:

#!/bin/bash
set -e
echo %team_servers%
for i in %team_servers%
do
    ssh -o StrictHostKeyChecking=no "$i" "sudo puppet agent --test --detailed-exitcodes || test $? -eq 2 "
done

# ssh -o StrictHostKeyChecking=no server "sudo puppet agent --test --detailed-exitcodes || test $? -eq 2 "
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for server
Info: Applying configuration version '1504027974'
Notice: /Stage[main]/Post_base/Post_base::Post_repo/Exec[update-yum-cache]/returns: executed successfully
Notice: Mcollective server password is undef or empty. Skipping mcollective server installation.
Notice: /Stage[main]/Mcollective_server/Notify[mcollective password error]/message: defined 'message' as 'Mcollective server password is undef or empty. Skipping mcollective server installation.'
Notice: Finished catalog run in 11.75 seconds
# echo $?
1

Ошибок нет, есть только изменения конфигурации.
Как избавиться от exit code 1?
The exit code after running with '--test' is 0 if the catalog was successfully applied, and 1 if the run either failed or wasn't attempted (due to another run already in progress).

у тебя выводит exit code от test. Сделай например так : puppet agent -t ; echo $?

Bers666 ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.