Skip to content

Instantly share code, notes, and snippets.

@valorin
Created December 6, 2014 21:31
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save valorin/94194e626afa0baa93be to your computer and use it in GitHub Desktop.
Save valorin/94194e626afa0baa93be to your computer and use it in GitHub Desktop.
Ansible tasks to configure Mosh and UFW to play nice
---
- name: Install Mosh PPA
apt_repository: repo='ppa:keithw/mosh'
- name: Install Mosh
apt: >
state=latest
pkg=mosh
update_cache=yes
- name: Copy Mosh Allow UFW script
copy: >
src=mosh-allow-ufw
dest=/usr/local/bin/mosh-allow-ufw
owner=root
group=root
mode=0755
- name: Mosh allow into bashrc
lineinfile: >
dest=/home/{{ item }}/.bashrc
line="sudo /usr/local/bin/mosh-allow-ufw"
regexp='mosh-allow-ufw'
state=present
with_items:
- valorin
- name: Mosh allow into sudoers
lineinfile: >
dest=/etc/sudoers
line="{{ item }} ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/mosh-allow-ufw"
regexp='mosh-allow-ufw'
state=present
with_items:
- valorin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment