From da60534b125ab5dd2766a0b542d999440e32943a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 8 May 2019 10:45:11 +0200 Subject: [PATCH] Jenkins: install a list of packages on the slaves too. --- jenkins/common/defaults/main.yml | 25 +++++++++++++++++++++++ jenkins/common/tasks/main.yml | 14 +++++++++++++ jenkins/master/defaults/main.yml | 17 --------------- jenkins/master/tasks/jenkins_deb_pkgs.yml | 2 +- jenkins/master/tasks/jenkins_rh_pkgs.yml | 2 +- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/jenkins/common/defaults/main.yml b/jenkins/common/defaults/main.yml index b63b5146..ca08468f 100644 --- a/jenkins/common/defaults/main.yml +++ b/jenkins/common/defaults/main.yml @@ -13,3 +13,28 @@ jenkins_maven_settings_dirs: - .m2 jenkins_maven_settings_url: http://localhost/settings.xml + +jenkins_common_deb_package_requirements: + - python-svn + - dblatex + - dos2unix + - build-essential + - curl + - fabric + - git + - git-svn + - maven + - python-dev + - sloccount + - subversion + - subversion-tools + - unzip + +jenkins_common_rh_package_requirements: + - curl + - dblatex + - docbook-utils-pdf + - texlive-cmap + - dos2unix + - maven + - git diff --git a/jenkins/common/tasks/main.yml b/jenkins/common/tasks/main.yml index d8d503ad..12434ca7 100644 --- a/jenkins/common/tasks/main.yml +++ b/jenkins/common/tasks/main.yml @@ -1,4 +1,18 @@ --- +- block: + - name: Install the common deb packages + apt: pkg={{ jenkins_common_deb_package_requirements }} state={{ jenkins_pkg_state }} update_cache=yes cache_valid_time=3600 + + when: ansible_distribution_file_variety == "Debian" + tags: [ 'jenkins', 'jenkins_common', 'jenkins_master', 'jenkins_slave', 'jenkins_slaves', 'jenkins_pkgs' ] + +- block: + - name: Install the common RH/CentOS packages + yum: pkg={{ jenkins_common_rh_package_requirements }} state={{ jenkins_pkg_state }} + + when: ansible_distribution_file_variety != "Debian" + tags: [ 'jenkins', 'jenkins_common', 'jenkins_master', 'jenkins_slave', 'jenkins_slaves', 'jenkins_pkgs' ] + - block: - name: Create the ssh key on the master node user: name={{ jenkins_username }} generate_ssh_key=True diff --git a/jenkins/master/defaults/main.yml b/jenkins/master/defaults/main.yml index 8345927a..d434bf07 100644 --- a/jenkins/master/defaults/main.yml +++ b/jenkins/master/defaults/main.yml @@ -15,27 +15,11 @@ jenkins_packages: - jenkins jenkins_deb_package_requirements: - - python-svn - - dblatex - imagemagick - graphviz - fonts-dejavu - - dos2unix - - build-essential - - curl - - fabric - - git - - git-svn - - maven - - python-dev - - sloccount - - subversion - - subversion-tools - - unzip jenkins_rh_package_requirements: - - curl - - dblatex - docbook-utils-pdf - texlive-cmap - ImageMagick @@ -46,7 +30,6 @@ jenkins_rh_package_requirements: - dejavu-sans-mono-fonts - dejavu-serif-fonts - dejavu-fonts-common - - dos2unix jenkins_stb_support: False jenkins_sbt_launch_jars: diff --git a/jenkins/master/tasks/jenkins_deb_pkgs.yml b/jenkins/master/tasks/jenkins_deb_pkgs.yml index 05f5993f..578ce455 100644 --- a/jenkins/master/tasks/jenkins_deb_pkgs.yml +++ b/jenkins/master/tasks/jenkins_deb_pkgs.yml @@ -37,7 +37,7 @@ register: jenkins_has_been_restarted when: jenkins_install - tags: [ 'jenkins', 'jenkins_master' ] + tags: [ 'jenkins', 'jenkins_master', 'jenkins_pkgs' ] - block: - name: Ensure that jenkins is stoppend and disabled diff --git a/jenkins/master/tasks/jenkins_rh_pkgs.yml b/jenkins/master/tasks/jenkins_rh_pkgs.yml index d329cf7b..3c27e85e 100644 --- a/jenkins/master/tasks/jenkins_rh_pkgs.yml +++ b/jenkins/master/tasks/jenkins_rh_pkgs.yml @@ -45,7 +45,7 @@ register: jenkins_has_been_restarted when: jenkins_install - tags: [ 'jenkins', 'jenkins_master' ] + tags: [ 'jenkins', 'jenkins_master', 'jenkins_pkgs' ] - block: - name: Remove jenkins