Created
November 5, 2020 12:25
-
-
Save kkourt/62f8d18eb03a1f68563fbb31f13673e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
become: true | |
vars: | |
gover: "1.13.15" | |
ciliumver: "1.7" | |
godir: "{{ ansible_env.HOME }}/go{{ gover }}" | |
tasks: | |
- name: Install dev packages | |
apt: | |
name: "{{ packages }}" | |
state: present | |
vars: | |
packages: | |
- git | |
- make | |
- clang-8 | |
- llvm-8 | |
- libelf-dev | |
- wget | |
- libc6-dev-i386 | |
- name: Download go | |
get_url: | |
url: "https://golang.org/dl/go{{ gover }}.linux-amd64.tar.gz" | |
dest: "~/go{{ gover }}.tar.gz" | |
- name: Check if go directory exists | |
stat: path="{{ godir }}" | |
register: gopath | |
- name: Extract go directory | |
command: "{{ item }}" | |
with_items: | |
- "tar zxvf go{{ gover }}.tar.gz" | |
- "mv go {{ godir }}" | |
when: not gopath.stat.exists | |
- name: Print godir | |
debug: | |
var: godir | |
- name: Install go packages | |
shell: | | |
go get -u github.com/cilium/go-bindata/... | |
go get -u github.com/onsi/ginkgo/ginkgo | |
go get -u github.com/onsi/gomega | |
go get -u github.com/gordonklaus/ineffassign | |
args: | |
executable: /bin/bash | |
environment: | |
PATH: "{{ godir }}/bin:{{ ansible_env.PATH }}" | |
- name: Download Cilium | |
git: | |
repo: https://github.com/cilium/cilium.git | |
dest: ~/cilium | |
version: "v{{ ciliumver }}" | |
- name: Build cilium | |
shell: | | |
echo $PATH | |
cd cilium | |
make CLANG=clang-8 LLC=llc-8 SKIP_DOCS=true | |
args: | |
executable: /bin/bash | |
environment: | |
PATH: "{{ godir }}/bin:{{ ansible_env.HOME }}/go/bin/:{{ ansible_env.PATH }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment