cmoa install ansible v2
This commit is contained in:
Binary file not shown.
BIN
00_ansible_setup/01_python3/01_python3-3.6.8-18.el7.x86_64.rpm
Normal file
BIN
00_ansible_setup/01_python3/01_python3-3.6.8-18.el7.x86_64.rpm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/02_pip/pip-20.3-py2.py3-none-any.whl
Normal file
BIN
00_ansible_setup/02_pip/pip-20.3-py2.py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/03_ansible/Jinja2-3.0.3-py3-none-any.whl
Normal file
BIN
00_ansible_setup/03_ansible/Jinja2-3.0.3-py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/03_ansible/ansible-4.10.0.tar.gz
Normal file
BIN
00_ansible_setup/03_ansible/ansible-4.10.0.tar.gz
Normal file
Binary file not shown.
BIN
00_ansible_setup/03_ansible/ansible-core-2.11.12.tar.gz
Normal file
BIN
00_ansible_setup/03_ansible/ansible-core-2.11.12.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/03_ansible/cryptography-39.0.1.tar.gz
Normal file
BIN
00_ansible_setup/03_ansible/cryptography-39.0.1.tar.gz
Normal file
Binary file not shown.
BIN
00_ansible_setup/03_ansible/packaging-21.3-py3-none-any.whl
Normal file
BIN
00_ansible_setup/03_ansible/packaging-21.3-py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/03_ansible/pycparser-2.21-py2.py3-none-any.whl
Normal file
BIN
00_ansible_setup/03_ansible/pycparser-2.21-py2.py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/03_ansible/pyparsing-3.0.9-py3-none-any.whl
Normal file
BIN
00_ansible_setup/03_ansible/pyparsing-3.0.9-py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/cachetools-4.2.4-py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/cachetools-4.2.4-py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/idna-3.4-py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/idna-3.4-py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/oauthlib-3.2.2-py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/oauthlib-3.2.2-py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/pyasn1-0.4.8-py2.py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/pyasn1-0.4.8-py2.py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/rsa-4.9-py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/rsa-4.9-py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/04_kubernetes/six-1.16.0-py2.py3-none-any.whl
Normal file
BIN
00_ansible_setup/04_kubernetes/six-1.16.0-py2.py3-none-any.whl
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
00_ansible_setup/05_minio/certifi-2022.12.7-py3-none-any.whl
Normal file
BIN
00_ansible_setup/05_minio/certifi-2022.12.7-py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/05_minio/minio-7.1.13-py3-none-any.whl
Normal file
BIN
00_ansible_setup/05_minio/minio-7.1.13-py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/05_minio/urllib3-1.26.14-py2.py3-none-any.whl
Normal file
BIN
00_ansible_setup/05_minio/urllib3-1.26.14-py2.py3-none-any.whl
Normal file
Binary file not shown.
BIN
00_ansible_setup/06_kubectl/kubectl.tar.gz
Normal file
BIN
00_ansible_setup/06_kubectl/kubectl.tar.gz
Normal file
Binary file not shown.
26
00_ansible_setup/setup_local.sh
Executable file
26
00_ansible_setup/setup_local.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-*
|
||||
|
||||
rpm_list=`find . -name "*.rpm"`
|
||||
|
||||
for rpm in ${rpm_list}
|
||||
do
|
||||
if [[ ${rpm} == *"01_python3"* ]]; then
|
||||
echo "rpm -ivh ${rpm} --nodeps"
|
||||
rpm -ivh ${rpm} --nodeps
|
||||
else
|
||||
echo "rpm -Uvh ${rpm}"
|
||||
rpm -Uvh ${rpm}
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
pip3 install --upgrade --no-index -f ./02-pip/pip-20.3-py2.py3-none-any.whl pip==20.3
|
||||
pip3 install --no-index -f ./03_ansible ansible
|
||||
pip3 install --no-index -f ./04_kubernetes kubernetes
|
||||
pip3 install --no-index -f ./05_minio Minio
|
||||
|
||||
tar xvfBpz ./06_kubectl/kubectl.tar.gz -C /usr/bin/
|
||||
12
README.md
12
README.md
@@ -1,13 +1,11 @@
|
||||
# ansible installer
|
||||
|
||||
1. 사전 작업 필요
|
||||
- 각 서버에 ssh-key 배포 후 연결
|
||||
- 확인 명령어
|
||||
: ansible all -m ping
|
||||
- CentOS ansible 설치 방법
|
||||
: yum install -y python3
|
||||
: pip3 install --upgrade --ignore-installed pip setuptools
|
||||
: pip3 install ansible
|
||||
: 00_ansible_setup 폴더 내 setup_local.sh 실행
|
||||
- 각 서버에 ssh-key 배포
|
||||
- 확인 명령어
|
||||
: ansible all -m ping -i <inventory file>
|
||||
|
||||
2. 수정필요파일
|
||||
- inventory
|
||||
@@ -23,4 +21,4 @@
|
||||
3. 실행 방법
|
||||
: ansible-playbook cmoa_install.yaml
|
||||
or
|
||||
: ansible-playbook cmoa_install.yaml -i inventory_cmoa2
|
||||
: ansible-playbook cmoa_install.yaml -i <inventory file>
|
||||
|
||||
@@ -3,4 +3,4 @@ inventory = inventory
|
||||
roles_path = roles
|
||||
deprecation_warnings = False
|
||||
display_skipped_hosts = no
|
||||
#ansible_home = .
|
||||
ansible_home = .
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
- hosts: cluster
|
||||
become: true
|
||||
gather_facts: true
|
||||
environment:
|
||||
KUBECONFIG: /root/.kube/ansible_config
|
||||
roles:
|
||||
- role: agent_os_setting
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
environment:
|
||||
KUBECONFIG: /root/.kube/ansible_config
|
||||
roles:
|
||||
- role: cmoa_os_setting
|
||||
# - role: cmoa_os_setting
|
||||
- role: cmoa_install
|
||||
delegate_to: 127.0.0.1
|
||||
|
||||
|
||||
@@ -12,11 +12,15 @@ master
|
||||
worker1
|
||||
worker2
|
||||
|
||||
|
||||
[master:vars]
|
||||
kubernetes_role="master"
|
||||
runtime="docker"
|
||||
|
||||
[worker1:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="containerd"
|
||||
|
||||
[worker2:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="crio"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
[master]
|
||||
10.10.43.213
|
||||
|
||||
[worker1]
|
||||
10.10.43.214
|
||||
|
||||
[worker2]
|
||||
10.10.43.215
|
||||
|
||||
[cluster:children]
|
||||
master
|
||||
worker1
|
||||
worker2
|
||||
|
||||
[master:vars]
|
||||
kubernetes_role="master"
|
||||
runtime="containerd"
|
||||
|
||||
[worker1:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="containerd"
|
||||
|
||||
[worker2:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="crio"
|
||||
@@ -1,25 +0,0 @@
|
||||
[master]
|
||||
10.10.43.216
|
||||
|
||||
[worker1]
|
||||
10.10.43.217
|
||||
|
||||
[worker2]
|
||||
10.10.43.218
|
||||
|
||||
[cluster:children]
|
||||
master
|
||||
worker1
|
||||
worker2
|
||||
|
||||
[master:vars]
|
||||
kubernetes_role="master"
|
||||
runtime="containerd"
|
||||
|
||||
[worker1:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="containerd"
|
||||
|
||||
[worker2:vars]
|
||||
kubernetes_role="node"
|
||||
runtime="crio"
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
|
||||
|
||||
namespace=$1
|
||||
|
||||
if [[ ${namespace} == "" ]]; then
|
||||
echo "[Usage] $0 <NAMESAPCE>"
|
||||
exit
|
||||
fi
|
||||
|
||||
pg_check=`sh postgres_check_data imxc`
|
||||
|
||||
if [[ ${pg_check} == 1 ]]; then
|
||||
echo "pg data already!"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "pg data insert start"
|
||||
|
||||
postgres=`kubectl get pods -n ${namespace} | grep postgres | awk '{print $1}'`
|
||||
|
||||
kubectl -n ${namespace} wait --for=condition=ready pod/${postgres} --timeout=1200s
|
||||
|
||||
kubectl cp postgres_insert_ddl.psql ${postgres}:/postgres_insert_ddl.psql -n ${namespace}
|
||||
kubectl cp postgres_insert_dml.psql ${postgres}:/postgres_insert_dml.psql -n ${namespace}
|
||||
|
||||
kubectl exec -it ${postgres} -n ${namespace} -- bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /postgres_insert_ddl.psql"
|
||||
|
||||
kubectl exec -it ${postgres} -n ${namespace} -- bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /postgres_insert_dml.psql"
|
||||
|
||||
|
||||
@@ -6,22 +6,28 @@
|
||||
mode: "0755"
|
||||
|
||||
- name: Fetch Helm package
|
||||
get_url:
|
||||
block:
|
||||
- get_url:
|
||||
url: 'https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz'
|
||||
dest: /tmp/helm.tar.gz
|
||||
checksum: '{{ helm_checksum }}'
|
||||
|
||||
rescue:
|
||||
- copy:
|
||||
src: "{{ role_path }}/utils/helm-v3.11.1-linux-amd64.tar.gz"
|
||||
dest: /tmp/helm.tar.gz
|
||||
|
||||
- name: Extract Helm package
|
||||
unarchive:
|
||||
remote_src: true
|
||||
src: /tmp/helm.tar.gz
|
||||
dest: /tmp/helm
|
||||
|
||||
- name: Ensure "docker" group exists
|
||||
group:
|
||||
name: docker
|
||||
state: present
|
||||
become: true
|
||||
#- name: Ensure "docker" group exists
|
||||
# group:
|
||||
# name: docker
|
||||
# state: present
|
||||
# become: true
|
||||
|
||||
- name: Install helm to /usr/local/bin
|
||||
copy:
|
||||
@@ -29,7 +35,7 @@
|
||||
src: /tmp/helm/linux-amd64/helm
|
||||
dest: /usr/local/bin/helm
|
||||
owner: root
|
||||
group: docker
|
||||
group: root
|
||||
mode: "0755"
|
||||
become: true
|
||||
|
||||
|
||||
BIN
roles/cmoa_install/utils/helm-v3.11.1-linux-amd64.tar.gz
Normal file
BIN
roles/cmoa_install/utils/helm-v3.11.1-linux-amd64.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user