-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae7ef56
commit 58fb295
Showing
10 changed files
with
132 additions
and
2 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 |
---|---|---|
|
@@ -81,6 +81,7 @@ jobs: | |
matrix: | ||
vm: | ||
- console | ||
- dockerservice | ||
- jenkins | ||
- rui | ||
- runner03 | ||
|
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
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,43 @@ | ||
--- | ||
- name: Play for docker_service.hayaworld.home | ||
hosts: dockerservice | ||
remote_user: hayato | ||
gather_facts: true | ||
become: true | ||
|
||
vars_files: | ||
- inventories/host_vars/docker_service.yml | ||
- inventories/host_vars/networks.yml | ||
|
||
handlers: | ||
- name: Restart handler tasks | ||
ansible.builtin.import_tasks: | ||
file: handlers/main.yml | ||
tags: | ||
- network | ||
|
||
tasks: | ||
- name: Common Settings | ||
ansible.builtin.import_tasks: | ||
file: tasks/all/main.yml | ||
|
||
- name: Install Docker(ce) | ||
ansible.builtin.import_role: | ||
name: geerlingguy.docker | ||
vars: | ||
docker_edition: 'ce' | ||
docker_packages_state: present | ||
docker_service_manage: true | ||
docker_service_state: started | ||
docker_service_enabled: true | ||
docker_restart_handler_state: restarted | ||
docker_users: | ||
- hayato | ||
|
||
- name: Mount skylark | ||
ansible.builtin.import_tasks: | ||
file: tasks/dockerservice/mount_docker.yml | ||
|
||
- name: Install/Config Zramswap | ||
ansible.builtin.import_tasks: | ||
file: tasks/zram.yml |
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,47 @@ | ||
--- | ||
apt: | ||
- curl | ||
- dstat | ||
- git | ||
- htop | ||
- jq | ||
- open-vm-tools | ||
- openssh-server | ||
- openssl | ||
- p7zip-full | ||
- python3-pip | ||
- sshpass | ||
- vim | ||
- zsh | ||
|
||
services_start: | ||
- docker | ||
- open-vm-tools | ||
- ssh | ||
|
||
dockerdir: | ||
UUID: "6db90b73-6dbd-4c00-9b13-724f0cb4e636" | ||
|
||
firewall: | ||
policy: deny | ||
allow_rules: | ||
- name: "SSH from service line" | ||
proto: "tcp" | ||
src: "192.168.1.0/24" | ||
port: '22' | ||
- name: "Zabbix from Zabbix-server" | ||
proto: "tcp" | ||
src: "192.168.1.106/24" | ||
port: "10050" | ||
- name: "HTTP Allow" | ||
proto: "tcp" | ||
src: "192.168.1.0/24" | ||
port: "80" | ||
- name: "HTTPS Allow" | ||
proto: "tcp" | ||
src: "192.168.1.0/24" | ||
port: "443" | ||
|
||
zramswap: | ||
algo: lz4 | ||
percent: 50 |
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
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 |
---|---|---|
|
@@ -21,3 +21,6 @@ | |
|
||
[macbook] | ||
HayabookAir2023.hayaworld.home ansible_user=hayato | ||
|
||
[dockerservice] | ||
192.168.1.101 ansible_user=hayato |
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
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 |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
state: present | ||
no_extra_spaces: true | ||
mode: "644" | ||
notify: "systemd-resolved" | ||
notify: "Restart systemd-resolved" |
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,23 @@ | ||
--- | ||
- name: "Check if exists /var/lib/docker" | ||
ansible.builtin.stat: | ||
path: "/var/lib/docker" | ||
follow: true | ||
register: dockerdir_stat | ||
failed_when: dockerdir_stat.stat.isdir == false | ||
|
||
- name: "Check if exists dockerdir drive" | ||
ansible.builtin.stat: | ||
path: "/dev/disk/by-uuid/{{ dockerdir.UUID }}" | ||
follow: true | ||
register: home_drive | ||
failed_when: home_drive.stat.isblk == false | ||
|
||
- name: "Mount dockerdir Drive" | ||
ansible.posix.mount: | ||
src: "UUID={{ dockerdir.UUID }}" | ||
path: "/var/lib/docker" | ||
opts: "defaults" | ||
fstype: ext4 | ||
state: mounted | ||
notify: "Restart docker" |
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,6 @@ | ||
_ _ _ | ||
__| | ___ ___| | _____ _ __ ___ ___ _ ____ _(_) ___ ___ | ||
/ _` |/ _ \ / __| |/ / _ \ '__| / __|/ _ \ '__\ \ / / |/ __/ _ \ | ||
| (_| | (_) | (__| < __/ | \__ \ __/ | \ V /| | (_| __/ | ||
\__,_|\___/ \___|_|\_\___|_| |___/\___|_| \_/ |_|\___\___| | ||
|