-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NEW] added minio installation ansible playbook
- Loading branch information
1 parent
a88af10
commit 5f103fd
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
- name: Install Jenkins on multiple OS | ||
hosts: jenkins_servers | ||
become: true | ||
vars: | ||
java_package_debian: openjdk-17-jre | ||
java_package_rhel: java-17-openjdk | ||
jenkins_repo_debian: https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | ||
jenkins_repo_rhel: https://pkg.jenkins.io/redhat-stable/jenkins.repo | ||
jenkins_key_rhel: https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key | ||
|
||
tasks: | ||
|
||
- name: Install Jenkins on Debian/Ubuntu | ||
when: ansible_os_family == "Debian" | ||
apt: | ||
update_cache: yes | ||
name: | ||
- fontconfig | ||
- "{{ java_package_debian }}" | ||
state: present | ||
|
||
- name: Add Jenkins keyring for Debian/Ubuntu | ||
when: ansible_os_family == "Debian" | ||
ansible.builtin.command: | ||
cmd: wget -O /usr/share/keyrings/jenkins-keyring.asc "{{ jenkins_repo_debian }}" | ||
|
||
- name: Add Jenkins repo to sources.list on Debian/Ubuntu | ||
when: ansible_os_family == "Debian" | ||
ansible.builtin.shell: | | ||
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/" | tee /etc/apt/sources.list.d/jenkins.list | ||
- name: Install Jenkins on Debian/Ubuntu | ||
when: ansible_os_family == "Debian" | ||
apt: | ||
update_cache: yes | ||
name: jenkins | ||
state: present | ||
|
||
- name: Enable and start Jenkins on Debian/Ubuntu | ||
when: ansible_os_family == "Debian" | ||
systemd: | ||
name: jenkins | ||
enabled: yes | ||
state: started | ||
|
||
- name: Install Jenkins on Red Hat/Fedora/Alma/Rocky | ||
when: ansible_os_family == "RedHat" | ||
ansible.builtin.command: | ||
cmd: wget -O /etc/yum.repos.d/jenkins.repo "{{ jenkins_repo_rhel }}" | ||
|
||
- name: Import Jenkins key on Red Hat/Fedora/Alma/Rocky | ||
when: ansible_os_family == "RedHat" | ||
ansible.builtin.command: | ||
cmd: rpm --import "{{ jenkins_key_rhel }}" | ||
|
||
- name: Upgrade packages on Red Hat/Fedora/Alma/Rocky | ||
when: ansible_os_family == "RedHat" | ||
ansible.builtin.yum: | ||
name: "*" | ||
state: latest | ||
|
||
- name: Install required dependencies on Red Hat/Fedora/Alma/Rocky | ||
when: ansible_os_family == "RedHat" | ||
ansible.builtin.yum: | ||
name: | ||
- fontconfig | ||
- "{{ java_package_rhel }}" | ||
- jenkins | ||
state: present | ||
|
||
- name: Enable and start Jenkins on Red Hat/Fedora/Alma/Rocky | ||
when: ansible_os_family == "RedHat" | ||
systemd: | ||
name: jenkins | ||
enabled: yes | ||
state: started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[jenkins_servers] | ||
server1 ansible_host=34.69.104.233 ansible_user=ismoilovdev | ||
server2 ansible_host=34.27.32.115 ansible_user=ismoilovdev | ||
server3 ansible_host=34.170.180.55 ansible_user=ismoilovdev |