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/.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/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 diff --git a/molecule/cloud-aws-direct/molecule.yml b/molecule/cloud-aws-direct/molecule.yml index d625c96..32c5b67 100644 --- a/molecule/cloud-aws-direct/molecule.yml +++ b/molecule/cloud-aws-direct/molecule.yml @@ -5,25 +5,24 @@ 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 - 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 @@ -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/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..b2cf458 --- /dev/null +++ b/tasks/repository_install/Suse.yml @@ -0,0 +1,6 @@ +--- +- name: Jenkins Repository + community.general.zypper_repository: + name: jenkins + repo: "{{ jenkins_zypper_repo_url }}" + state: present 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 @@ +--- 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 new file mode 100644 index 0000000..d86a46a --- /dev/null +++ b/vars/Suse.yml @@ -0,0 +1,6 @@ +--- +jenkins_requirements: [] + +jenkins_config_service_path: /etc/sysconfig/jenkins + +jenkins_zypper_repo_url: https://pkg.jenkins.io/opensuse-stable/?ssl_verify=no