cmoa install ansible v2

This commit is contained in:
havelight-ee
2023-02-16 21:40:53 +09:00
parent a98fc02ef7
commit 60c7d6a5b8
50 changed files with 53 additions and 109 deletions

View File

@@ -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"

View File

@@ -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