Merge pull request #169 from lpmi-13/ansible_way

The Ansible Way
This commit is contained in:
Luke Stephens (hakluke) 2020-02-05 01:24:52 +10:00 committed by GitHub
commit 3ebd352be3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -668,7 +668,7 @@ echo "set modeline" >> .vimrc
## The Circuit Breaker Way ## The Circuit Breaker Way
Credit:@Tomcat-42 Credit:@Tomcat-42
1. Smoothly leave your computer 1. Leave your computer
2. Find the nearest electrical circuit breaker panel 2. Find the nearest electrical circuit breaker panel
3. Switch off and on the main breaker 3. Switch off and on the main breaker
4. Return to your computer 4. Return to your computer
@ -676,12 +676,43 @@ Credit:@Tomcat-42
**Note:** This approach prove itself ineffective against notebooks, desktops on a UPS or remote servers. **Note:** This approach prove itself ineffective against notebooks, desktops on a UPS or remote servers.
## The Permanent Way ## The Ansible Way
Credit: @jofftiquez Credit: @lpmi-13
***Quit software engineering for good.*** run vim.yml playbook with the following contents:
```
---
- hosts: vimbox
vars:
required_packages:
- vim
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
- name: Update APT package cache
apt:
update_cache: yes
- name: Run apt-get upgrade
apt: upgrade=safe
- name: Install required packages
apt: state=installed pkg={{ item }}
with_items: "{{ required_packages }}"
- name: Start Vim in the background.
shell: "(vim >/dev/null 2>&1 &)"
- name: Quit Vim.
shell: "(pkill vim)"
```
## The Stack Overflow Way ## The Stack Overflow Way
Credit: @cobaltblu27 Credit: @cobaltblu27
*Yeah exiting vim is really frustrating sometimes. You should definately try using Neovim. It's fast, has terminal emulator, and also supports plugin that will help you exit vim.* *Yeah exiting vim is really frustrating sometimes. You should definately try using Neovim. It's fast, has terminal emulator, and also supports plugin that will help you exit vim.*