X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=packer%2Fprovision%2Flocal-docker.yaml;h=c3c9f1731897818108819e7c737969c2d51ee859;hb=27f55b72480dbe6e27ea30f725c771beaf9da135;hp=acf6fa422f75742f0a6398643c5e5ea111cf3bab;hpb=9dd84546663f6954986550e2bec2f51842e28014;p=ci-management.git diff --git a/packer/provision/local-docker.yaml b/packer/provision/local-docker.yaml index acf6fa422..c3c9f1731 100644 --- a/packer/provision/local-docker.yaml +++ b/packer/provision/local-docker.yaml @@ -9,10 +9,21 @@ docker_compose_version: 1.17.1 glide_checksum: sha256:c403933503ea40308ecfadcff581ff0dc3190c57958808bb9eed016f13f6f32c glide_version: v0.13.1 - golang_checksum: sha256:07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7 golang_version: 1.9.1 tasks: + - name: "Checking for x86_64" + set_fact: + host_arch: "amd64" + golang_checksum: sha256:07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7 + when: "'x86_64' in ansible_architecture" + + - name: "Checking for aarch64" + set_fact: + host_arch: "arm64" + golang_checksum: sha256:d31ecae36efea5197af271ccce86ccc2baf10d2e04f20d0fb75556ecf0614dad + when: "'aarch64' in ansible_architecture" + - name: 'Install Docker Compose {{docker_compose_version}}' command: curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/{{docker_compose_version}}/docker-compose-Linux-x86_64" become: true @@ -24,14 +35,14 @@ - name: 'Install GoLang {{golang_version}}' block: - - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-amd64.tar.gz' + - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' get_url: - url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-amd64.tar.gz' - dest: '/tmp/go{{golang_version}}.linux-amd64.tar.gz' + url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-{{host_arch}}.tar.gz' + dest: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' checksum: '{{golang_checksum}}' - name: 'Install golang {{golang_version}} to /usr/local' unarchive: - src: '/tmp/go{{golang_version}}.linux-amd64.tar.gz' + src: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' dest: /usr/local remote_src: true become: true @@ -47,10 +58,11 @@ name: libxml2-utils state: present become: true + when: ansible_distribution == 'Ubuntu' - name: Install python-tox - apt: - name: python-tox + pip: + name: tox state: present become: true @@ -58,22 +70,41 @@ repo: ppa:jonathonf/python-3.6 state: present become: true + when: ansible_distribution == 'Ubuntu' + + - apt_repository: + repo: ppa:deadsnakes/ppa + state: present + become: true + when: ansible_distribution == 'Ubuntu' - name: Update and upgrade apt packages apt: upgrade: yes update_cache: yes become: true + when: ansible_distribution == 'Ubuntu' - name: Install Python 3.6 and packages apt: name: - python3.6 - python3.6-dev + - python3.6-tk - libssl-dev - libmysqlclient-dev - gcc become: true + when: ansible_distribution == 'Ubuntu' + + - name: Install Python 3.7 + apt: + name: + - python3.7 + - python3.7-dev + - python3.7-tk + become: true + when: ansible_distribution == 'Ubuntu' - name: Install base packages apt: @@ -89,6 +120,7 @@ - libssl-dev - libffi-dev become: true + when: ansible_distribution == 'Ubuntu' - name: Install autorelease support packages apt: @@ -99,26 +131,31 @@ - maven - python-ncclient become: true + when: ansible_distribution == 'Ubuntu' - name: Add Google Chrome key apt_key: url: https://dl-ssl.google.com/linux/linux_signing_key.pub state: present become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Add Google Chrome repo copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644 become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Update apt cache apt: update_cache=yes become: true + when: ansible_distribution == 'Ubuntu' - name: Install Google Chrome apt: name: google-chrome-stable state: present become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Install Erlang dependency packages apt: @@ -127,22 +164,25 @@ - libsctp1 - libwxbase3.0-0v5 become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Install Erlang apt: - deb: https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb - install_recommends: yes + deb: https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Clone rebar3 git: repo: 'https://github.com/erlang/rebar3.git' dest: /tmp/rebar3 + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Bootstrap rebar3 command: ./bootstrap args: chdir: /tmp/rebar3 + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Install rebar3 to bin copy: @@ -151,11 +191,13 @@ mode: 0755 remote_src: true become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Remove unused rebar3 source file: path: /tmp/rebar3 state: absent + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Download geckodriver unarchive: @@ -164,6 +206,7 @@ mode: 0755 remote_src: yes become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Download Firefox version 55.0.3 unarchive: @@ -172,6 +215,7 @@ mode: 0755 remote_src: yes become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' - name: Create symbolic link to firefox bin file: @@ -179,3 +223,11 @@ dest: "/usr/bin/firefox" state: link become: true + when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' + + - name: Install jinja2 + pip: + name: jinja2 + state: present + become: true + when: ansible_architecture == 'x86_64'