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:

  1. git clone https://github.com/mobile-shell/mosh
  2. cd mosh
  3. ./autogen.sh
  4. ./configure
  5. 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

Popular posts from this blog

ansible 5

practical 3