From 3c899726e7949083eafcbdb9a8816786a3eae0f1 Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 11:05:26 +0300 Subject: [PATCH 1/6] add SLES12 support --- vars/Suse.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 vars/Suse.yml diff --git a/vars/Suse.yml b/vars/Suse.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/vars/Suse.yml @@ -0,0 +1 @@ +--- From 81f86994b4a5458a11c736a93c6799d84360deff Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 11:21:24 +0300 Subject: [PATCH 2/6] fix lint --- molecule/cloud-aws-direct/molecule.yml | 11 +++-------- tasks/system/Suse.yml | 1 + 2 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 tasks/system/Suse.yml diff --git a/molecule/cloud-aws-direct/molecule.yml b/molecule/cloud-aws-direct/molecule.yml index d625c96..fa9d3f7 100644 --- a/molecule/cloud-aws-direct/molecule.yml +++ b/molecule/cloud-aws-direct/molecule.yml @@ -5,10 +5,9 @@ dependency: role-file: requirements.yml driver: name: ec2 -lint: - name: yamllint - options: - config-file: .yamllint +lint: | + yamllint + ansible-lint platforms: - name: test-aws-centos8-jenkins image: ami-0ed2ad9dc845b42b6 @@ -90,11 +89,7 @@ provisioner: prepare: ../resources/prepare.yml destroy: ../resources/provisioning/AWS/destroy.yml verify: ../resources/tests/verify.yml - lint: - name: ansible-lint scenario: name: cloud-aws-direct verifier: name: ansible - lint: - name: ansible-lint diff --git a/tasks/system/Suse.yml b/tasks/system/Suse.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/tasks/system/Suse.yml @@ -0,0 +1 @@ +--- From 3d326707ec32793c1c18f91e87160d32c845a9c7 Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 11:23:19 +0300 Subject: [PATCH 3/6] add sles12 support --- tasks/configure/Suse.yml | 4 + tasks/repository_install/Suse.yml | 1 + .../Suse_configuration.j2 | 113 ++++++++++++++++++ vars/Suse.yml | 2 + 4 files changed, 120 insertions(+) create mode 100644 tasks/configure/Suse.yml create mode 100644 tasks/repository_install/Suse.yml create mode 100644 templates/jenkins_system_config/Suse_configuration.j2 diff --git a/tasks/configure/Suse.yml b/tasks/configure/Suse.yml new file mode 100644 index 0000000..0cf249a --- /dev/null +++ b/tasks/configure/Suse.yml @@ -0,0 +1,4 @@ +--- +# included file +- name: Force all notified handlers to run + meta: flush_handlers diff --git a/tasks/repository_install/Suse.yml b/tasks/repository_install/Suse.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/tasks/repository_install/Suse.yml @@ -0,0 +1 @@ +--- diff --git a/templates/jenkins_system_config/Suse_configuration.j2 b/templates/jenkins_system_config/Suse_configuration.j2 new file mode 100644 index 0000000..2e1f6af --- /dev/null +++ b/templates/jenkins_system_config/Suse_configuration.j2 @@ -0,0 +1,113 @@ +## Path: Development/Jenkins +## Description: Jenkins Automation Server +## Type: string +## Default: "/var/lib/jenkins" +## ServiceRestart: jenkins +# +# Directory where Jenkins store its configuration and working +# files (checkouts, build reports, artifacts, ...). +# +JENKINS_HOME='{{ jenkins2_home_directory }}' + +## Type: string +## Default: "/bin/bash" +## ServiceRestart: jenkins +# +# Shell used to initialize the Jenkins server's environment. +# Setting this option to the path of a shell executable allows +# initialization of the Jenkins server environment using +# standard shell startup scripts. +# Disabling this option causes the Jenkins server to be run +# with a minimal environment. +# +JENKINS_INIT_SHELL="/bin/bash" + +## Type: string +## Default: "" +## ServiceRestart: jenkins +# +# Java runtime to run Jenkins +# When left empty, the current system default JRE, as defined +# by update-alternatives(8), is used. +# +JENKINS_JAVA_HOME="" + +## Type: string +## Default: "jenkins" +## ServiceRestart: jenkins +# +# Unix user account that runs the Jenkins daemon +# Be careful when you change this, as you need to update +# permissions of $JENKINS_HOME and /var/log/jenkins, +# and if you have already run Jenkins, potentially other +# directories such as /var/cache/jenkins . +# +JENKINS_USER='{{ jenkins2_user }}' + +## Type: integer(-20:20) +## Default: 0 +## ServiceRestart: jenkins +# +# The nice level at which the Jenkins server (and its build jobs) run. +# +JENKINS_NICE="0" + +## Type: string +## Default: "-Djava.awt.headless=true" +## ServiceRestart: jenkins +# +# Options to pass to java when running Jenkins. +# +JENKINS_JAVA_OPTIONS='{{ jenkins2_config_java_options }}{{ (jenkins2_permissive_script_enabled | bool) | ternary(" -Dpermissive-script-security.enabled=no_security","") }}' + +## Type: integer(0:65535) +## Default: 8080 +## ServiceRestart: jenkins +# +# Port Jenkins is listening on. +# Set to -1 to disable +# +JENKINS_PORT={{ jenkins2_config_http_port }} + + +## Type: integer(1:9) +## Default: 5 +## ServiceRestart: jenkins +# +# Debug level for logs -- the higher the value, the more verbose. +# 5 is INFO. +# +JENKINS_DEBUG_LEVEL={{ jenkins2_config_debug_level }} + +## Type: yesno +## Default: no +## ServiceRestart: jenkins +# +# Whether to enable access logging or not. +# +JENKINS_ENABLE_ACCESS_LOG='{{ jenkins2_config_enable_access_log }}' + +## Type: integer +## Default: 100 +## ServiceRestart: jenkins +# +# Maximum number of HTTP worker threads. +# +JENKINS_HANDLER_MAX={{ jenkins2_config_handler_max }} + +## Type: integer +## Default: 20 +## ServiceRestart: jenkins +# +# Maximum number of idle HTTP worker threads. +# +JENKINS_HANDLER_IDLE={{ jenkins2_config_handler_idle }} + +## Type: string +## Default: "" +## ServiceRestart: jenkins +# +# Pass arbitrary arguments to Jenkins. +# Full option list: java -jar jenkins.war --help +# +JENKINS_ARGS='{{ jenkins2_config_args }}' diff --git a/vars/Suse.yml b/vars/Suse.yml index ed97d53..5492822 100644 --- a/vars/Suse.yml +++ b/vars/Suse.yml @@ -1 +1,3 @@ --- +jenkins_requirements: [] +jenkins_config_service_path: /etc/sysconfig/jenkins From 82830c25eb57e648d80137d261d3255971c73632 Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 12:25:18 +0300 Subject: [PATCH 4/6] fix ansible-lint, delete travis --- .ansible-lint | 4 ++-- README.md | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 3f52e41..0e2d885 100755 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,7 +1,7 @@ +--- exclude_paths: - - ./.travis.yml - ./molecule/ rulesdir: - ~/ansible-lint-rules/rules/ use_default_rules: true -verbosity: 1 \ No newline at end of file +verbosity: 1 diff --git a/README.md b/README.md index c45a935..7d832ff 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Jenkins 2 installation ========= [![License](https://img.shields.io/badge/license-Apache-green.svg?style=flat)](https://raw.githubusercontent.com/lean-delivery/ansible-role-jenkins/master/LICENSE) -[![Build Status](https://travis-ci.org/lean-delivery/ansible-role-jenkins.svg?branch=master)](https://travis-ci.org/lean-delivery/ansible-role-jenkins) [![Build Status](https://gitlab.com/lean-delivery/ansible-role-jenkins/badges/master/build.svg)](https://gitlab.com/lean-delivery/ansible-role-jenkins/pipelines) [![Galaxy](https://img.shields.io/badge/galaxy-lean_delivery.jenkins-blue.svg)](https://galaxy.ansible.com/lean_delivery/jenkins) ![Ansible](https://img.shields.io/ansible/role/d/29895.svg) @@ -29,7 +28,7 @@ Requirements ------------ - Minimal Version of the ansible for installation: 2.7 - - **Java 8** [![Build Status](https://travis-ci.org/lean-delivery/ansible-role-java.svg?branch=master)](https://travis-ci.org/lean-delivery/ansible-role-java) + - **Java 8** - **Supported OS**: - CentOS - 8 From 3ceec36d1e35f6dbad2c6fcc3822a5ae095cf56d Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 13:14:38 +0300 Subject: [PATCH 5/6] disable centos8 test --- molecule/cloud-aws-direct/molecule.yml | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/molecule/cloud-aws-direct/molecule.yml b/molecule/cloud-aws-direct/molecule.yml index fa9d3f7..32c5b67 100644 --- a/molecule/cloud-aws-direct/molecule.yml +++ b/molecule/cloud-aws-direct/molecule.yml @@ -9,20 +9,20 @@ lint: | yamllint ansible-lint platforms: - - name: test-aws-centos8-jenkins - image: ami-0ed2ad9dc845b42b6 - platform: centos8 - instance_type: m5.large - region: us-east-1 - vpc_subnet_id: subnet-0f2b9cd66faea38af - assign_public_ip: false - spot_price: 0.05 - security_group_name: - - default - wait_timeout: 1800 - ssh_user: centos - groups: - - rhel_family +# - name: test-aws-centos8-jenkins +# image: ami-0ed2ad9dc845b42b6 +# platform: centos8 +# instance_type: m5.large +# region: us-east-1 +# vpc_subnet_id: subnet-0f2b9cd66faea38af +# assign_public_ip: false +# spot_price: 0.05 +# security_group_name: +# - default +# wait_timeout: 1800 +# ssh_user: centos +# groups: +# - rhel_family - name: test-aws-Amazon2-jenkins image: ami-0b898040803850657 From 180dbb1c4fc5bbafccf8dfd1daf30cc9e936eb4e Mon Sep 17 00:00:00 2001 From: Dzmitry Rudnouski Date: Wed, 2 Feb 2022 18:19:08 +0300 Subject: [PATCH 6/6] suse support --- .github/workflows/build.yml | 19 +++++++++++++++++++ tasks/repository_install/Suse.yml | 5 +++++ vars/Suse.yml | 3 +++ 3 files changed, 27 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da378ee..30fced0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,3 +27,22 @@ jobs: ansible-galaxy install -r requirements.yml cd .. ansible-playbook ansible-role-jenkins/playbook.yml + opensuse-leap: + runs-on: ubuntu-22.04 + container: opensuse/leap:latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + with: + fetch-depth: 0 + - name: Install ansible + run: | + sudo apt-add-repository --yes --update ppa:ansible/ansible + sudo apt-get update + sudo apt-get install ansible -y + ansible --version + - name: Run playbook + run: | + ansible-galaxy install -r requirements.yml + cd .. + ansible-playbook ansible-role-jenkins/playbook.yml diff --git a/tasks/repository_install/Suse.yml b/tasks/repository_install/Suse.yml index ed97d53..b2cf458 100644 --- a/tasks/repository_install/Suse.yml +++ b/tasks/repository_install/Suse.yml @@ -1 +1,6 @@ --- +- name: Jenkins Repository + community.general.zypper_repository: + name: jenkins + repo: "{{ jenkins_zypper_repo_url }}" + state: present diff --git a/vars/Suse.yml b/vars/Suse.yml index 5492822..d86a46a 100644 --- a/vars/Suse.yml +++ b/vars/Suse.yml @@ -1,3 +1,6 @@ --- jenkins_requirements: [] + jenkins_config_service_path: /etc/sysconfig/jenkins + +jenkins_zypper_repo_url: https://pkg.jenkins.io/opensuse-stable/?ssl_verify=no