exam 16
Write a playbook /home/thor/playbooks/install_from_source.yml
to install a tool: mosh
from the source:https://github.com/mobile-shell/mosh
on all servers inside the inventory /home/thor/playbooks/inventory
.
A normal install from source flow is:
- git clone https://github.com/mobile-shell/mosh
- cd mosh
- ./autogen.sh
- ./configure
- make && make install
To compile mosh from source, you need these dependencies:
- git
- make
- autoconf
- automake
- protobuf-devel
- libutempter-devel
- ncurses-devel
- openssl-devel
- gcc
- gcc-c++
Create install_from_source.yml
playbook and add below given code
---
- hosts: all
tasks:
- package:
name: "{{ item }}"
state: present
with_items:
- git
- make
- autoconf
- automake
- protobuf-devel
- libutempter-devel
- ncurses-devel
- openssl-devel
- gcc
- gcc-c++
- git:
repo: https://github.com/mobile-shell/mosh
dest: /tmp/mosh
force: yes
- shell: ./autogen.sh && ./configure && make && make install
args:
chdir: /tmp/mosh
Comments
Post a Comment