This repository has been archived by the owner on Apr 26, 2020. It is now read-only.
/
main.yml
52 lines (49 loc) · 1.64 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- name: personal laptop setup on ubuntu
hosts: localhost
connection: local
vars:
- home: "{{ansible_env.HOME}}"
- dropbox_version: 2015.10.28_amd64
roles:
- gnome-shell
- misc
- dropbox
- atom-editor
- terminator
- ansiblebit.launchpad-ppa-webupd8
- role: ansiblebit.oracle-java
ansiblebit.oracle-java:
oracle_java_set_as_default: yes
#~ - role: nvm
#~ nvm:
#~ version: v0.29.0
#~ node_version: stable
tasks:
- name: enable bash history search with page-up and page-down
become: yes
shell: >
cp --no-clobber /etc/inputrc /etc/inputrc.backup &&
cat /etc/inputrc.backup
| sed 's/^# \(.* history-search-.*\)/\1/g'
> /etc/inputrc
# replace lines
# HISTSIZE=1000
# HISTFILESIZE=2000
# #force_color_prompt=yes
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# with
# HISTSIZE=100000
# HISTFILESIZE=100000
# force_color_prompt=yes
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \n\$ '
#
# Note: "'" represents a single quote escaped in double quotes
- name: edit .bashrc (history size and color prompt)
shell: >
cp --no-clobber {{home}}/.bashrc {{home}}/.bashrc.backup &&
cat {{home}}/.bashrc.backup
| sed 's/^\(HIST[A-Z]*SIZE\)=[0-9]\+/\1=100000/g'
| sed 's/^#\(force_color_prompt=yes\)/\1/'
| sed 's/PS1=\(.*\033.*\)\(\\$ '"'"'\)/PS1=\1 \\n\2/'
> {{home}}/.bashrc