ansible-jenkins

Ansible playbook: Jenkins

  • Owner: ICTO/ansible-jenkins
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Readme

Description

ansible-jenkins is an Ansible role.
Use this role to install Jenkins and install/update plugins.

Provides

  1. Latest Jenkins server
  2. Jenkins plugins support

Requires

  1. Ansible 2.2 or higher
  2. Debian 8, Ubuntu 14, CentOS 7, FreeBSD 10 or later
  3. Vagrant (optional)

Usage

Install from Ansible Galaxy

$ ansible-galaxy install flyapen.jenkins

Or download manually

$ git clone https://github.com/ICTO/ansible-jenkins.git roles

The code should reside in the roles directory of ansible ( See ansible documentation for more information on roles ), in a folder jenkins.

Create a host file

Following example make ansible aware of the Vagrant box reachable on localhost port 2222.

$ vi ansible.host

with

[jenkins]
127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key

Create host specific variables

Make the host_vars directory where ansible.host file is located.

$ mkdir host_vars

Create a file in the newly created directory matching your host.

$ cd host_vars
$ vi 127.0.0.1

with

---
plugins:
  - 'ldap'
  - 'github'
  - 'translation'
  - 'preSCMbuildstep'
email:
  smtp_host: 'mail.example.com'
  smtp_ssl: 'true'
  default_email_suffix: '@example.com'
#jenkins_admin_user: admin
#jenkins_admin_password: admin

Take a look at the defaults/main.yml file which contains all possible variables.

Run the playbook

First create a playbook including the jenkins role, naming it jenkins.yml.

- name: Jenkins
  hosts: jenkins
  roles:
    # install jenkins
    - { role: jenkins, become: yes, become_user: root }

Use ansible.host as inventory. Run the playbook only for the remote host jenkins. Use vagrant as the SSH user to connect to the remote host. -k enables the SSH password prompt.

$ ansible-playbook -i ansible.host jenkins.yml

Main metrics

Overview
Name With OwnerICTO/ansible-jenkins
Primary LanguageGroovy
Program languageGroovy (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2013-03-05 10:06:44
Pushed At2020-09-30 18:41:15
Last Commit At
Release Count4
Last Release Namev1.2.0 (Posted on )
First Release Namepre-role (Posted on 2013-10-29 15:52:46)
用户参与
Stargazers Count281
Watchers Count28
Fork Count170
Commits Count100
Has Issues Enabled
Issues Count20
Issue Open Count8
Pull Requests Count29
Pull Requests Open Count3
Pull Requests Close Count13
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private