first cosmoserver commit
This commit is contained in:
@ -1,12 +1,21 @@
|
||||
---
|
||||
# get arch
|
||||
- name: Cosmostat - Init - Check CPU Arch
|
||||
shell: "dpkg --print-architecture"
|
||||
register: cpu_architecture_output
|
||||
|
||||
- name: Cosmostat - Init - Set x64_arch variable
|
||||
when: "'arm64' in cpu_architecture_output.stdout"
|
||||
set_fact:
|
||||
x64_arch: false
|
||||
|
||||
# package handler
|
||||
- name: Cosmostat - Init - Get installed package list
|
||||
when: dpkg_output is undefined
|
||||
shell: "dpkg --list | grep ii | awk '{print $2}'"
|
||||
register: dpkg_output
|
||||
|
||||
- name: Cosmostat - Init - Install Prereq Packages
|
||||
when: cosmostat_packages_item not in dpkg_output.stdout
|
||||
when: cosmostat_packages_item not in dpkg_output.stdout_lines
|
||||
apt:
|
||||
name:
|
||||
- "{{ cosmostat_packages_item }}"
|
||||
@ -16,12 +25,25 @@
|
||||
loop_var: cosmostat_packages_item
|
||||
|
||||
# docker network for cosmostat service
|
||||
- name: Cosmostat - Init - Set Up docker network
|
||||
community.docker.docker_network:
|
||||
name: "cosmostat_net"
|
||||
driver: bridge
|
||||
ipam_config:
|
||||
- subnet: "{{ docker_subnet }}"
|
||||
- name: Cosmostat - Init - Check for docker network
|
||||
shell: "ip -o -4 ad | grep {{ docker_gateway }} | wc -l"
|
||||
register: docker_network_register
|
||||
|
||||
- name: Cosmostat - Init - Run Network Handlers
|
||||
when: docker_network_register.stdout | int == 0
|
||||
block:
|
||||
|
||||
- name: Cosmostat - Init - Set Up docker network x64
|
||||
when: x64_arch | bool
|
||||
community.docker.docker_network:
|
||||
name: "cosmostat_net"
|
||||
driver: bridge
|
||||
ipam_config:
|
||||
- subnet: "{{ docker_subnet }}"
|
||||
|
||||
- name: Cosmostat - Init - Set Up docker network arm64
|
||||
when: not x64_arch | bool
|
||||
shell: "docker network create --driver bridge --subnet {{ docker_subnet }} cosmostat_net"
|
||||
|
||||
# allow service_user to sudo lshw without a password
|
||||
- name: Cosmostat - Init - cosmos user sudoers file creation
|
||||
|
||||
Reference in New Issue
Block a user