Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sol1 Ansible Roles
sol1-bashrc
Commits
e2c696a7
Commit
e2c696a7
authored
May 12, 2020
by
Matthew Smith
Browse files
Initial commit
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
defaults/main.yml
0 → 100644
View file @
e2c696a7
---
bash_vi_mode
:
false
bash_aliases
:
-
{
name
:
grep
,
value
:
'
grep
--color'
}
-
{
name
:
ls
,
value
:
'
ls
--color'
}
-
{
name
:
ll
,
value
:
'
ls
-l'
}
-
{
name
:
la
,
value
:
'
ls
-la'
}
-
{
name
:
ltr
,
value
:
'
ls
-ltr'
}
tasks/main.yml
0 → 100644
View file @
e2c696a7
---
# contents of /etc/skel/ are copied to user on useradd
-
name
:
get all bashrc files
find
:
paths
:
[
"
/etc/skel/"
,
"
/root/"
,
"
/home/sol1/"
]
patterns
:
'
.bashrc'
recurse
:
yes
hidden
:
yes
register
:
bashrc
-
name
:
make sure force_color_prompt is on
replace
:
path
:
"
{{
item.path
}}"
regexp
:
'
#force_color_prompt=yes'
replace
:
'
force_color_prompt=yes'
with_items
:
"
{{
bashrc.files
}}"
-
name
:
make sure PS1 matches
lineinfile
:
path
:
"
{{
item.path
}}"
regexp
:
'
^[#
]*PS1=.*'
line
:
'
PS1="${debian_chroot:+($debian_chroot)}\[\e[01;32m\]\u@\h\[\e[m\]:\[\e[01;36m\]\w\[\e[m\]#
"'
# insertafter: "# bash PS1 added by Ansible role bashrc"
with_items
:
"
{{
bashrc.files
}}"
-
name
:
change the colour for root
replace
:
path
:
"
{{
item.path
}}"
regexp
:
'
01;32m'
replace
:
'
01;31m'
with_items
:
"
{{
bashrc.files
}}"
when
:
item.path == '/root/.bashrc'
-
name
:
aliases heading
lineinfile
:
path
:
"
{{
item.path
}}"
line
:
"
#
bash
aliases
added
by
Ansible
role
bashrc"
state
:
present
with_items
:
"
{{
bashrc.files
}}"
-
name
:
Create bash aliases
lineinfile
:
path
:
"
{{
item.0.path
}}"
regexp
:
"
alias
{{
item.1.name
}}="
line
:
"
alias
{{
item.1.name
}}='{{
item.1.value
}}'"
insertafter
:
"
#
bash
aliases
added
by
Ansible
role
bashrc"
with_nested
:
-
"
{{
bashrc.files
}}"
-
"
{{
bash_aliases
}}"
-
name
:
vi mode heading
lineinfile
:
path
:
"
{{
item.path
}}"
line
:
"
#
bash
vi
mode
added
by
Ansible
role
bashrc"
state
:
present
with_items
:
"
{{
bashrc.files
}}"
when
:
bash_vi_mode ==
true
-
name
:
vi mode on
lineinfile
:
path
:
"
{{
item.path
}}"
line
:
'
set
-o
vi'
insertafter
:
"
#
bash
vi
mode
added
by
Ansible
role
bashrc"
state
:
present
with_items
:
"
{{
bashrc.files
}}"
when
:
bash_vi_mode ==
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment