Skip to content

Instantly share code, notes, and snippets.

@kkourt
Created November 5, 2020 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkourt/62f8d18eb03a1f68563fbb31f13673e9 to your computer and use it in GitHub Desktop.
Save kkourt/62f8d18eb03a1f68563fbb31f13673e9 to your computer and use it in GitHub Desktop.
- 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