diff options
-rw-r--r-- | ansible/ansible.cfg | 1 | ||||
-rwxr-xr-x | ansible/docker/build_ansible_image.sh | 10 | ||||
-rwxr-xr-x | ansible/group_vars/infrastructure.yml | 2 | ||||
-rw-r--r-- | ansible/group_vars/kubernetes.yml | 2 | ||||
-rw-r--r-- | ansible/infrastructure.yml | 2 | ||||
-rw-r--r-- | ansible/roles/rancher/tasks/rancher_server.yml | 4 | ||||
-rwxr-xr-x | ansible/run_playbook.sh | 6 | ||||
-rwxr-xr-x | build_nexus_blob.sh | 10 | ||||
-rwxr-xr-x | package.sh | 10 |
9 files changed, 31 insertions, 16 deletions
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index c2ee3ff3..0978b814 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -6,3 +6,4 @@ # relative path ./application is mapped into ansible container under # /ansible/application where application roles should be found roles_path = /ansible/application +log_path = /ansible/log/ansible.log diff --git a/ansible/docker/build_ansible_image.sh b/ansible/docker/build_ansible_image.sh index d54ddc43..49833be5 100755 --- a/ansible/docker/build_ansible_image.sh +++ b/ansible/docker/build_ansible_image.sh @@ -27,14 +27,12 @@ image_name="${2:-ansible:latest}" script_path=$(readlink -f "$0") script_dir=$(dirname "$script_path") -git_commit=$(git rev-parse --revs-only HEAD) +git_commit=$(git rev-parse --revs-only HEAD || true) build_date=$(date -I) -if [ -z "$ansible_version" ]; then - docker build "$script_dir" -t "${image_name}" --label "git-commit=$git_commit" --label "build-date=$build_date" -else - docker build "$script_dir" -t "${image_name}" --label "git-commit=$git_commit" --label "build-date=$build_date" --build-arg ansible_version="$ansible_version" -fi +docker build "$script_dir" -t "${image_name}" --label "build-date=$build_date" \ + ${git_commit:+--label git-commit=${git_commit}} \ + ${ansible_version:+--build-arg ansible_version=${ansible_version}} # Export docker image into chroot and tararchive it. It takes ~40M of space and is packaged together with sw. if "${script_dir}"/create_docker_chroot.sh convert "${image_name}" "${script_dir}"/ansible_chroot ; then diff --git a/ansible/group_vars/infrastructure.yml b/ansible/group_vars/infrastructure.yml index ab314055..9fd88f25 100755 --- a/ansible/group_vars/infrastructure.yml +++ b/ansible/group_vars/infrastructure.yml @@ -1,5 +1,4 @@ --- -nfs_mount_path: /dockerdata-nfs vnc_passwd: samsung simulated_hosts: git: @@ -26,6 +25,7 @@ simulated_hosts: all_simulated_hosts: "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}" rancher_server_url: "http://{{ hostvars[groups.infrastructure.0].ansible_host }}:8080" +rancher_server_version: v1.6.22 rancher_remove_other_env: yes rancher_redeploy_k8s_env: yes populate_nexus: no diff --git a/ansible/group_vars/kubernetes.yml b/ansible/group_vars/kubernetes.yml new file mode 100644 index 00000000..869c35f3 --- /dev/null +++ b/ansible/group_vars/kubernetes.yml @@ -0,0 +1,2 @@ +--- +nfs_mount_path: /dockerdata-nfs diff --git a/ansible/infrastructure.yml b/ansible/infrastructure.yml index 709a351e..08667330 100644 --- a/ansible/infrastructure.yml +++ b/ansible/infrastructure.yml @@ -61,7 +61,7 @@ - role: nexus vars: phase: runtime-populate - when: runtime_images is defined + when: runtime_images is defined and runtime_images is not none - name: Setup base for Kubernetes nodes hosts: kubernetes diff --git a/ansible/roles/rancher/tasks/rancher_server.yml b/ansible/roles/rancher/tasks/rancher_server.yml index 9abf986b..64b35e4c 100644 --- a/ansible/roles/rancher/tasks/rancher_server.yml +++ b/ansible/roles/rancher/tasks/rancher_server.yml @@ -1,9 +1,9 @@ --- # DO NOT ADD SPACE AROUND ';' -- name: Start rancher/server:v1.6.14 +- name: Start rancher/server:{{ rancher_server_version }} docker_container: name: rancher_server - image: rancher/server:v1.6.14 + image: rancher/server:{{ rancher_server_version }} command: ["sh", "-c", "/usr/sbin/update-ca-certificates;/usr/bin/entry /usr/bin/s6-svscan /service"] ports: 8080:8080 state: started diff --git a/ansible/run_playbook.sh b/ansible/run_playbook.sh index 9a2ca56f..2edbe358 100755 --- a/ansible/run_playbook.sh +++ b/ansible/run_playbook.sh @@ -25,6 +25,7 @@ script_path=$(readlink -f "$0") script_name=$(basename "$script_path") ANSIBLE_DIR=$(dirname "$script_path") ANSIBLE_CHROOT="${ANSIBLE_DIR}/ansible_chroot" +ANSIBLE_LOG_PATH="/ansible/log/ansible-$(date +%Y.%m.%d-%H%M%S).log" # @@ -82,6 +83,8 @@ REQUIREMENTS: # run playbook # +export ANSIBLE_LOG_PATH + # if no arg then print help and exit if [ -z "$1" ] ; then help @@ -101,6 +104,8 @@ if [ -n "$ANSIBLE_DOCKER_IMAGE" ] ; then -v "$ANSIBLE_DIR:/ansible:ro" \ -v "$ANSIBLE_DIR/application:/ansible/application:rw" \ -v "$ANSIBLE_DIR/certs/:/certs:rw" \ + -v "$ANSIBLE_DIR/log/:/ansible/log:rw" \ + -e ANSIBLE_LOG_PATH \ -it "${ANSIBLE_DOCKER_IMAGE}" "$@" fi @@ -123,6 +128,7 @@ fi --mount rw:"${HOME}/.ssh":/root/.ssh \ --mount ro:"$ANSIBLE_DIR":/ansible \ --mount rw:"$ANSIBLE_DIR"/application:/ansible/application \ + --mount rw:"$ANSIBLE_DIR"/log:/ansible/log \ --mount rw:"$ANSIBLE_DIR"/certs:/certs \ --mount ro:/etc/resolv.conf:/etc/resolv.conf \ --mount ro:/etc/hosts:/etc/hosts \ diff --git a/build_nexus_blob.sh b/build_nexus_blob.sh index aa977793..e57658c2 100755 --- a/build_nexus_blob.sh +++ b/build_nexus_blob.sh @@ -139,13 +139,11 @@ fi # Check the dependencies in the beginning -# Install Node.js -if yum list installed "nodejs" >/dev/null 2>&1; then - echo "Node.js is already installed" +# Install jq +if yum list installed "jq" >/dev/null 2>&1; then + echo "jq is already installed" else - yum install -y --setopt=skip_missing_names_on_install=False epel-release - curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - - yum install -y --setopt=skip_missing_names_on_install=False nodejs + yum install -y --setopt=skip_missing_names_on_install=False http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jq-1.5-1.el7.x86_64.rpm fi # Install curl if necessary @@ -79,6 +79,15 @@ function add_additions { fi } +function build_sw_artifacts { + cd ansible/docker + ./build_ansible_image.sh + if [ $? -ne 0 ]; then + crash 5 "Building of ansible runner image failed." + fi + cd - +} + function create_sw_package { local pkg_root="${PACKAGING_TARGET_DIR}/onap" @@ -204,6 +213,7 @@ whotest[0]='test' || (crash 3 "Arrays not supported in this version of bash.") # Prepare output directory for our packaging and create all tars rm -rf ${PACKAGING_TARGET_DIR} +build_sw_artifacts create_sw_package create_resource_package |