Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins.hayaworld.localの初期設定 #129

Merged
merged 3 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inventories/host_vars/jenkins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
6 changes: 3 additions & 3 deletions inventories/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
[docker]
192.168.1.107 ansible_user=hayato

[jenkins]
192.168.1.111 ansible_user=hayato

[tm]
192.168.1.112 ansible_user=hayato

[jenkins]
192.168.1.131 ansible_user=hayato

[skylark]
192.168.1.200 ansible_user=hayato

Expand Down
63 changes: 63 additions & 0 deletions jenkins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
- name: Play for jenkins.hayaworld.local
hosts: jenkins
remote_user: hayato
gather_facts: true
become: true

vars_files:
- inventories/host_vars/jenkins.yml
- inventories/host_vars/networks.yml

tasks:
- name: Set Hostname
ansible.builtin.hostname:
name: "{{ network.jenkins.hostname }}"
tags:
- network

- name: Put authorized Key
ansible.builtin.import_tasks:
file: tasks/authorized_keys.yml

- name: Put motd file
ansible.builtin.import_tasks:
file: tasks/motd.yml
vars:
shortname: "{{ network.jenkins.shortname }}"

- name: Disable SELinux
ansible.builtin.import_tasks:
file: tasks/stop-selinux.yml

- name: Set Timezones
ansible.builtin.import_tasks:
file: tasks/timezone.yml

- name: Set zabbix agent
ansible.builtin.import_tasks:
file: tasks/zabbix-agent2.yml

- name: Stop Apt-daily
ansible.builtin.import_tasks:
file: tasks/stop-apt-daily.yml

- name: Stop cloud-init
ansible.builtin.import_tasks:
file: tasks/stop-cloud-init.yml

- name: Stop multipathd logging when running on VM
ansible.builtin.import_tasks:
file: tasks/stop-multipathd-syslog.yml

- name: Install Jenkins
ansible.builtin.import_role:
name: geerlingguy.jenkins
vars:
jenkins_package_state: present
jenkins_hostname: jenkins.hayaworld.local
jenkins_home: /var/lib/jenkins
jenkins_http_port: 8080
jenkins_java_options: "-Djenkins.install.runSetupWizard=false"
tags:
- jenkins
1 change: 1 addition & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ roles:
- name: brianhartsock.avahi
- name: mrlesmithjr.netplan
- name: geerlingguy.docker
- name: geerlingguy.jenkins

collections:
- name: alvistack.gitlab
Expand Down
6 changes: 6 additions & 0 deletions templates/jenkins/etc/motd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_ _ _
(_) ___ _ __ | | _(_)_ __ ___
| |/ _ \ '_ \| |/ / | '_ \/ __|
| | __/ | | | <| | | | \__ \
_/ |\___|_| |_|_|\_\_|_| |_|___/
|__/