Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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