diff options
| -rw-r--r-- | sliver-c2/playbook.yaml | 1 | ||||
| -rw-r--r-- | sliver-c2/tasks/golang_install.yaml | 33 | 
2 files changed, 34 insertions, 0 deletions
| diff --git a/sliver-c2/playbook.yaml b/sliver-c2/playbook.yaml index 9c73175..2447e16 100644 --- a/sliver-c2/playbook.yaml +++ b/sliver-c2/playbook.yaml @@ -6,6 +6,7 @@      - vars/sliver.yaml    tasks:      - import_tasks: tasks/apt_packages.yaml +    - import_tasks: tasks/golang_install.yaml      - import_tasks: tasks/harden.yaml      - import_tasks: tasks/sliver_install.yaml      - import_tasks: tasks/sliver_systemd.yaml diff --git a/sliver-c2/tasks/golang_install.yaml b/sliver-c2/tasks/golang_install.yaml new file mode 100644 index 0000000..e67d508 --- /dev/null +++ b/sliver-c2/tasks/golang_install.yaml @@ -0,0 +1,33 @@ +- name: download and extract golang +  block: +    - name: get latest golang version +      shell: | +        curl -sSL https://golang.org/dl/ | awk -F '"' '/dl\/.*linux-amd64.*tar.gz/{print $(NF-1)}' | awk -F '/' '{print $3}' | head -1 +      register: latest_golang +      changed_when: false + +    - name: download golang +      get_url: +        url: "https://golang.org/dl/{{ latest_golang.stdout }}" +        dest: /tmp/golang.tar.gz + +    - name: extract golang to /usr/local +      unarchive: +        src: /tmp/golang.tar.gz +        dest: /usr/local +        remote_src: yes + +    - name: remove tarball +      file: +        path: /tmp/golang.tar.gz +        state: absent + +    - name: set system-wide go environment variables +      copy: +        dest: /etc/profile.d/go_env.sh +        content: | +          export GOPATH=/root/go +          export PATH=$PATH:/usr/local/go/bin:$GOPATH:$GOPATH/bin +        owner: root +        group: root +        mode: '0644' |