From 11650feaa4877050ee2ebef4193c272b2e4b134c Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Sun, 5 May 2024 05:30:05 +0900 Subject: [PATCH] Initial Zabbix.hayaworld.local playbook --- inventories/host_vars/jenkins.yml | 1 + inventories/hosts | 6 ++-- jenkins.yml | 51 +++++++++++++++++++++++++++++++ templates/jenkins/etc/motd | 6 ++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 inventories/host_vars/jenkins.yml create mode 100644 jenkins.yml create mode 100644 templates/jenkins/etc/motd diff --git a/inventories/host_vars/jenkins.yml b/inventories/host_vars/jenkins.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/inventories/host_vars/jenkins.yml @@ -0,0 +1 @@ +--- diff --git a/inventories/hosts b/inventories/hosts index 004de5b..eb59246 100644 --- a/inventories/hosts +++ b/inventories/hosts @@ -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 diff --git a/jenkins.yml b/jenkins.yml new file mode 100644 index 0000000..2d81245 --- /dev/null +++ b/jenkins.yml @@ -0,0 +1,51 @@ +--- +- 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 diff --git a/templates/jenkins/etc/motd b/templates/jenkins/etc/motd new file mode 100644 index 0000000..0393daa --- /dev/null +++ b/templates/jenkins/etc/motd @@ -0,0 +1,6 @@ + _ _ _ + (_) ___ _ __ | | _(_)_ __ ___ + | |/ _ \ '_ \| |/ / | '_ \/ __| + | | __/ | | | <| | | | \__ \ + _/ |\___|_| |_|_|\_\_|_| |_|___/ +|__/