Created
October 18, 2014 10:41
-
-
Save mvdpoel/288ef389abc5329e3ebd to your computer and use it in GitHub Desktop.
ansible_megatools_role
This file contains hidden or 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
| --- | |
| - name: Include OS-specific variables. | |
| include_vars: "{{ ansible_os_family }}.yml" | |
| - name: Ensure packages are installed (Debian Family). | |
| sudo: true | |
| apt: > | |
| name={{ item }} | |
| state=installed | |
| with_items: __required_packages | |
| notify: restart webserver | |
| when: ansible_os_family == 'Debian' | |
| - name: Figure out which file to download | |
| sudo: false | |
| shell: wget -qO- "http://megatools.megous.com/builds/" | sed -e "s/<[^>]*>/ /g" | awk "{print \\$1}" | grep -E "^megatools-[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.tar\.gz$" | sort -t. -k1,1Vr -k2,2Vr -k3,3Vr | head -n1 | |
| register: file_to_download | |
| - debug: var=file_to_download msg="winner file_to_download" | |
| - name: Download megatools | |
| sudo: false | |
| shell: "wget -q http://megatools.megous.com/builds/{{file_to_download.stdout}}" | |
| args: | |
| creates: "{{file_to_download.stdout}}" | |
| - name: "Unpack {{file_to_download.stdout}}" | |
| shell: "tar -zxf {{file_to_download.stdout}}" | |
| - name: Register src folder | |
| sudo: false | |
| shell: ls -tr | head -n1 | |
| register: src_folder | |
| - name: "Configure" | |
| sudo: false | |
| shell: "./configure" | |
| args: | |
| chdir: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}" | |
| creates: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}/Makefile" | |
| - name: "Make" | |
| sudo: false | |
| shell: "make" | |
| args: | |
| chdir: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}" | |
| creates: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}/Makefile" | |
| #- name: "Make check" | |
| # shell: "make check" | |
| # args: | |
| # chdir: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}" | |
| - name: "Make install" | |
| sudo: true | |
| shell: "make install" | |
| args: | |
| chdir: "/home/{{ansible_ssh_user}}/{{ src_folder.stdout }}" |
This file contains hidden or 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: server | |
| roles: | |
| - { role: mvdpoel.megatools} |
This file contains hidden or 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
| ansible-playbook megatools.yml -v | |
| _______________ | |
| < PLAY [server] > | |
| --------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| _________________ | |
| < GATHERING FACTS > | |
| ----------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| ok: [server] | |
| __________________________________________________________ | |
| < TASK: mvdpoel.megatools | Include OS-specific variables. > | |
| ---------------------------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| ok: [server] => {"ansible_facts": {"__required_packages": ["curl", "wget", "gcc", "pkg-config", "libglib2.0-dev", "libcurl4-openssl-dev", "openssl", "build-essential"]}, "item": ""} | |
| _________________________________________________________ | |
| / TASK: mvdpoel.megatools | Ensure packages are installed \ | |
| \ (Debian Family). / | |
| --------------------------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| ok: [server] => (item=curl,wget,gcc,pkg-config,libglib2.0-dev,libcurl4-openssl-dev,openssl,build-essential) => {"changed": false, "item": "curl,wget,gcc,pkg-config,libglib2.0-dev,libcurl4-openssl-dev,openssl,build-essential"} | |
| _____________________________________________________________ | |
| < TASK: mvdpoel.megatools | Figure out which file to download > | |
| ------------------------------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| changed: [server] => {"changed": true, "cmd": "wget -qO- \"http://megatools.megous.com/builds/\" | sed -e \"s/<[^>]*>/ /g\" | awk \"{print \\$1}\" | grep -E \"^megatools-[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.tar\\.gz$\" | sort -t. -k1,1Vr -k2,2Vr -k3,3Vr | head -n1 ", "delta": "0:00:00.259622", "end": "2014-10-18 12:10:40.990086", "item": "", "rc": 0, "start": "2014-10-18 12:10:40.730464", "stderr": "", "stdout": "megatools-1.9.92.tar.gz"} | |
| ______________________________________________________ | |
| / TASK: mvdpoel.megatools | debug var=file_to_download \ | |
| \ msg="winner file_to_download" / | |
| ------------------------------------------------------ | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| ok: [server] => { | |
| "item": "", | |
| "msg": "winner file_to_download" | |
| } | |
| ______________________________________________ | |
| < TASK: mvdpoel.megatools | Download megatools > | |
| ---------------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| skipping: [server] | |
| __________________________________ | |
| / TASK: mvdpoel.megatools | Unpack \ | |
| \ {{file_to_download.stdout}} / | |
| ---------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| changed: [server] => {"changed": true, "cmd": "tar -zxf megatools-1.9.92.tar.gz ", "delta": "0:00:00.027366", "end": "2014-10-18 12:10:41.533422", "item": "", "rc": 0, "start": "2014-10-18 12:10:41.506056", "stderr": "", "stdout": ""} | |
| _______________________________________________ | |
| < TASK: mvdpoel.megatools | Register src folder > | |
| ----------------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| changed: [server] => {"changed": true, "cmd": "ls -tr | head -n1 ", "delta": "0:00:00.004252", "end": "2014-10-18 12:10:41.769863", "item": "", "rc": 0, "start": "2014-10-18 12:10:41.765611", "stderr": "", "stdout": "megatools-1.9.92"} | |
| _____________________________________ | |
| < TASK: mvdpoel.megatools | Configure > | |
| ------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| skipping: [server] | |
| ________________________________ | |
| < TASK: mvdpoel.megatools | Make > | |
| -------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| skipping: [server] | |
| ________________________________________ | |
| < TASK: mvdpoel.megatools | Make install > | |
| ---------------------------------------- | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| failed: [server] => {"changed": true, "cmd": " make install ", "delta": "0:00:00.681618", "end": "2014-10-18 12:10:43.184620", "item": "", "rc": 2, "start": "2014-10-18 12:10:42.503002"} | |
| stderr: /usr/bin/install: cannot remove '/usr/local/lib/libmega.so.0.0.0': Permission denied | |
| make[4]: *** [install-libLTLIBRARIES] Error 1 | |
| make[3]: *** [install-am] Error 2 | |
| make[2]: *** [install-recursive] Error 1 | |
| make[1]: *** [install] Error 2 | |
| make: *** [install-recursive] Error 1 | |
| stdout: Making install in mega | |
| GEN mega-marshal.c | |
| GEN mega-marshal.h | |
| make install-recursive | |
| Making install in gjs | |
| make[4]: Nothing to be done for `install-exec-am'. | |
| /bin/mkdir -p '/usr/local/share/gjs-1.0' | |
| /usr/bin/install -c -m 644 mega.js '/usr/local/share/gjs-1.0' | |
| CC mega-marshal.lo | |
| CCLD libmega.la | |
| /bin/mkdir -p '/usr/local/lib' | |
| /bin/bash ../libtool --mode=install /usr/bin/install -c libmega.la '/usr/local/lib' | |
| libtool: install: /usr/bin/install -c .libs/libmega.so.0.0.0 /usr/local/lib/libmega.so.0.0.0 | |
| FATAL: all hosts have already failed -- aborting | |
| ____________ | |
| < PLAY RECAP > | |
| ------------ | |
| \ ^__^ | |
| \ (oo)\_______ | |
| (__)\ )\/\ | |
| ||----w | | |
| || || | |
| to retry, use: --limit @/home/martin/megatools.retry | |
| server : ok=7 changed=3 unreachable=0 failed=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment