diff --git a/00_ansible_setup/01_python3/00_libtirpc-0.2.4-0.16.el7.x86_64.rpm b/00_ansible_setup/01_python3/00_libtirpc-0.2.4-0.16.el7.x86_64.rpm new file mode 100644 index 0000000..0a7aece Binary files /dev/null and b/00_ansible_setup/01_python3/00_libtirpc-0.2.4-0.16.el7.x86_64.rpm differ diff --git a/00_ansible_setup/01_python3/01_python3-3.6.8-18.el7.x86_64.rpm b/00_ansible_setup/01_python3/01_python3-3.6.8-18.el7.x86_64.rpm new file mode 100644 index 0000000..2e94112 Binary files /dev/null and b/00_ansible_setup/01_python3/01_python3-3.6.8-18.el7.x86_64.rpm differ diff --git a/00_ansible_setup/01_python3/02_python3-setuptools-39.2.0-10.el7.noarch.rpm b/00_ansible_setup/01_python3/02_python3-setuptools-39.2.0-10.el7.noarch.rpm new file mode 100644 index 0000000..598195e Binary files /dev/null and b/00_ansible_setup/01_python3/02_python3-setuptools-39.2.0-10.el7.noarch.rpm differ diff --git a/00_ansible_setup/01_python3/03_python3-libs-3.6.8-18.el7.x86_64.rpm b/00_ansible_setup/01_python3/03_python3-libs-3.6.8-18.el7.x86_64.rpm new file mode 100644 index 0000000..8b0d88c Binary files /dev/null and b/00_ansible_setup/01_python3/03_python3-libs-3.6.8-18.el7.x86_64.rpm differ diff --git a/00_ansible_setup/01_python3/04_python3-pip-9.0.3-8.el7.noarch.rpm b/00_ansible_setup/01_python3/04_python3-pip-9.0.3-8.el7.noarch.rpm new file mode 100644 index 0000000..526ce79 Binary files /dev/null and b/00_ansible_setup/01_python3/04_python3-pip-9.0.3-8.el7.noarch.rpm differ diff --git a/00_ansible_setup/02_pip/pip-20.3-py2.py3-none-any.whl b/00_ansible_setup/02_pip/pip-20.3-py2.py3-none-any.whl new file mode 100644 index 0000000..13b86a1 Binary files /dev/null and b/00_ansible_setup/02_pip/pip-20.3-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/03_ansible/Jinja2-3.0.3-py3-none-any.whl b/00_ansible_setup/03_ansible/Jinja2-3.0.3-py3-none-any.whl new file mode 100644 index 0000000..d87a929 Binary files /dev/null and b/00_ansible_setup/03_ansible/Jinja2-3.0.3-py3-none-any.whl differ diff --git a/00_ansible_setup/03_ansible/MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl b/00_ansible_setup/03_ansible/MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl new file mode 100644 index 0000000..d4e3afa Binary files /dev/null and b/00_ansible_setup/03_ansible/MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl differ diff --git a/00_ansible_setup/03_ansible/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl b/00_ansible_setup/03_ansible/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl new file mode 100644 index 0000000..1dfb5c2 Binary files /dev/null and b/00_ansible_setup/03_ansible/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl differ diff --git a/00_ansible_setup/03_ansible/ansible-4.10.0.tar.gz b/00_ansible_setup/03_ansible/ansible-4.10.0.tar.gz new file mode 100644 index 0000000..3d9a9ae Binary files /dev/null and b/00_ansible_setup/03_ansible/ansible-4.10.0.tar.gz differ diff --git a/00_ansible_setup/03_ansible/ansible-core-2.11.12.tar.gz b/00_ansible_setup/03_ansible/ansible-core-2.11.12.tar.gz new file mode 100644 index 0000000..5e5ac6a Binary files /dev/null and b/00_ansible_setup/03_ansible/ansible-core-2.11.12.tar.gz differ diff --git a/00_ansible_setup/03_ansible/cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl b/00_ansible_setup/03_ansible/cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl new file mode 100644 index 0000000..3c7fcb7 Binary files /dev/null and b/00_ansible_setup/03_ansible/cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl differ diff --git a/00_ansible_setup/03_ansible/cryptography-39.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl b/00_ansible_setup/03_ansible/cryptography-39.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl new file mode 100644 index 0000000..855b010 Binary files /dev/null and b/00_ansible_setup/03_ansible/cryptography-39.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl differ diff --git a/00_ansible_setup/03_ansible/cryptography-39.0.1.tar.gz b/00_ansible_setup/03_ansible/cryptography-39.0.1.tar.gz new file mode 100644 index 0000000..cf99ac2 Binary files /dev/null and b/00_ansible_setup/03_ansible/cryptography-39.0.1.tar.gz differ diff --git a/00_ansible_setup/03_ansible/packaging-21.3-py3-none-any.whl b/00_ansible_setup/03_ansible/packaging-21.3-py3-none-any.whl new file mode 100644 index 0000000..913cc21 Binary files /dev/null and b/00_ansible_setup/03_ansible/packaging-21.3-py3-none-any.whl differ diff --git a/00_ansible_setup/03_ansible/pycparser-2.21-py2.py3-none-any.whl b/00_ansible_setup/03_ansible/pycparser-2.21-py2.py3-none-any.whl new file mode 100644 index 0000000..fef6735 Binary files /dev/null and b/00_ansible_setup/03_ansible/pycparser-2.21-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/03_ansible/pyparsing-3.0.9-py3-none-any.whl b/00_ansible_setup/03_ansible/pyparsing-3.0.9-py3-none-any.whl new file mode 100644 index 0000000..597df22 Binary files /dev/null and b/00_ansible_setup/03_ansible/pyparsing-3.0.9-py3-none-any.whl differ diff --git a/00_ansible_setup/03_ansible/resolvelib-0.5.4-py2.py3-none-any.whl b/00_ansible_setup/03_ansible/resolvelib-0.5.4-py2.py3-none-any.whl new file mode 100644 index 0000000..5a84154 Binary files /dev/null and b/00_ansible_setup/03_ansible/resolvelib-0.5.4-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl b/00_ansible_setup/04_kubernetes/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl new file mode 100644 index 0000000..1dfb5c2 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl differ diff --git a/00_ansible_setup/04_kubernetes/cachetools-4.2.4-py3-none-any.whl b/00_ansible_setup/04_kubernetes/cachetools-4.2.4-py3-none-any.whl new file mode 100644 index 0000000..66e98f6 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/cachetools-4.2.4-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/certifi-2022.12.7-py3-none-any.whl b/00_ansible_setup/04_kubernetes/certifi-2022.12.7-py3-none-any.whl new file mode 100644 index 0000000..a083056 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/certifi-2022.12.7-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/charset_normalizer-2.0.12-py3-none-any.whl b/00_ansible_setup/04_kubernetes/charset_normalizer-2.0.12-py3-none-any.whl new file mode 100644 index 0000000..17a2dfb Binary files /dev/null and b/00_ansible_setup/04_kubernetes/charset_normalizer-2.0.12-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/google_auth-2.16.0-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/google_auth-2.16.0-py2.py3-none-any.whl new file mode 100644 index 0000000..7e001ad Binary files /dev/null and b/00_ansible_setup/04_kubernetes/google_auth-2.16.0-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/idna-3.4-py3-none-any.whl b/00_ansible_setup/04_kubernetes/idna-3.4-py3-none-any.whl new file mode 100644 index 0000000..7343c68 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/idna-3.4-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/kubernetes-26.1.0-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/kubernetes-26.1.0-py2.py3-none-any.whl new file mode 100644 index 0000000..1c303e3 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/kubernetes-26.1.0-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/oauthlib-3.2.2-py3-none-any.whl b/00_ansible_setup/04_kubernetes/oauthlib-3.2.2-py3-none-any.whl new file mode 100644 index 0000000..0beae92 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/oauthlib-3.2.2-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/pyasn1-0.4.8-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/pyasn1-0.4.8-py2.py3-none-any.whl new file mode 100644 index 0000000..e5c31b3 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/pyasn1-0.4.8-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/pyasn1_modules-0.2.8-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/pyasn1_modules-0.2.8-py2.py3-none-any.whl new file mode 100644 index 0000000..be18fa3 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/pyasn1_modules-0.2.8-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/python_dateutil-2.8.2-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/python_dateutil-2.8.2-py2.py3-none-any.whl new file mode 100644 index 0000000..8ffb923 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/python_dateutil-2.8.2-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/requests-2.27.1-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/requests-2.27.1-py2.py3-none-any.whl new file mode 100644 index 0000000..807fc61 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/requests-2.27.1-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/requests_oauthlib-1.3.1-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/requests_oauthlib-1.3.1-py2.py3-none-any.whl new file mode 100644 index 0000000..175d6d4 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/requests_oauthlib-1.3.1-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/rsa-4.9-py3-none-any.whl b/00_ansible_setup/04_kubernetes/rsa-4.9-py3-none-any.whl new file mode 100644 index 0000000..fb90f65 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/rsa-4.9-py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/six-1.16.0-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/six-1.16.0-py2.py3-none-any.whl new file mode 100644 index 0000000..fd94265 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/six-1.16.0-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/urllib3-1.26.14-py2.py3-none-any.whl b/00_ansible_setup/04_kubernetes/urllib3-1.26.14-py2.py3-none-any.whl new file mode 100644 index 0000000..2e969c0 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/urllib3-1.26.14-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/04_kubernetes/websocket_client-1.3.1-py3-none-any.whl b/00_ansible_setup/04_kubernetes/websocket_client-1.3.1-py3-none-any.whl new file mode 100644 index 0000000..fd7f053 Binary files /dev/null and b/00_ansible_setup/04_kubernetes/websocket_client-1.3.1-py3-none-any.whl differ diff --git a/00_ansible_setup/05_minio/certifi-2022.12.7-py3-none-any.whl b/00_ansible_setup/05_minio/certifi-2022.12.7-py3-none-any.whl new file mode 100644 index 0000000..a083056 Binary files /dev/null and b/00_ansible_setup/05_minio/certifi-2022.12.7-py3-none-any.whl differ diff --git a/00_ansible_setup/05_minio/minio-7.1.13-py3-none-any.whl b/00_ansible_setup/05_minio/minio-7.1.13-py3-none-any.whl new file mode 100644 index 0000000..8c32a93 Binary files /dev/null and b/00_ansible_setup/05_minio/minio-7.1.13-py3-none-any.whl differ diff --git a/00_ansible_setup/05_minio/urllib3-1.26.14-py2.py3-none-any.whl b/00_ansible_setup/05_minio/urllib3-1.26.14-py2.py3-none-any.whl new file mode 100644 index 0000000..2e969c0 Binary files /dev/null and b/00_ansible_setup/05_minio/urllib3-1.26.14-py2.py3-none-any.whl differ diff --git a/00_ansible_setup/06_kubectl/kubectl.tar.gz b/00_ansible_setup/06_kubectl/kubectl.tar.gz new file mode 100644 index 0000000..1030cdd Binary files /dev/null and b/00_ansible_setup/06_kubectl/kubectl.tar.gz differ diff --git a/00_ansible_setup/setup_local.sh b/00_ansible_setup/setup_local.sh new file mode 100755 index 0000000..2aa0191 --- /dev/null +++ b/00_ansible_setup/setup_local.sh @@ -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/ diff --git a/README.md b/README.md index 972762d..1fb1d09 100644 --- a/README.md +++ b/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 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 diff --git a/ansible.cfg b/ansible.cfg index 72c8c68..fba5bca 100755 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,4 +3,4 @@ inventory = inventory roles_path = roles deprecation_warnings = False display_skipped_hosts = no -#ansible_home = . +ansible_home = . diff --git a/cmoa_agent_install.yaml b/cmoa_agent_install.yaml deleted file mode 100755 index f645fbb..0000000 --- a/cmoa_agent_install.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- hosts: cluster - become: true - gather_facts: true - environment: - KUBECONFIG: /root/.kube/ansible_config - roles: - - role: agent_os_setting - diff --git a/cmoa_install.yaml b/cmoa_install.yaml index 9837135..424a4e9 100755 --- a/cmoa_install.yaml +++ b/cmoa_install.yaml @@ -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 diff --git a/inventory b/inventory index ffc1423..861a6b5 100755 --- a/inventory +++ b/inventory @@ -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" diff --git a/inventory_agent1 b/inventory_agent1 deleted file mode 100755 index 4ce4c34..0000000 --- a/inventory_agent1 +++ /dev/null @@ -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" diff --git a/inventory_agent2 b/inventory_agent2 deleted file mode 100755 index ee5be24..0000000 --- a/inventory_agent2 +++ /dev/null @@ -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" diff --git a/roles/cmoa_install/files/03-ddl-dml/postgres/test.sh b/roles/cmoa_install/files/03-ddl-dml/postgres/test.sh deleted file mode 100644 index 7717402..0000000 --- a/roles/cmoa_install/files/03-ddl-dml/postgres/test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi - -namespace=$1 - -if [[ ${namespace} == "" ]]; then - echo "[Usage] $0 " - 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" - - diff --git a/roles/cmoa_install/tasks/helm-install.yml b/roles/cmoa_install/tasks/helm-install.yml index d057455..cb36100 100644 --- a/roles/cmoa_install/tasks/helm-install.yml +++ b/roles/cmoa_install/tasks/helm-install.yml @@ -6,10 +6,16 @@ mode: "0755" - name: Fetch Helm package - get_url: - url: 'https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz' - dest: /tmp/helm.tar.gz - checksum: '{{ helm_checksum }}' + 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: @@ -17,11 +23,11 @@ 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 diff --git a/roles/cmoa_install/utils/helm-v3.11.1-linux-amd64.tar.gz b/roles/cmoa_install/utils/helm-v3.11.1-linux-amd64.tar.gz new file mode 100644 index 0000000..9bbc9de Binary files /dev/null and b/roles/cmoa_install/utils/helm-v3.11.1-linux-amd64.tar.gz differ