If you have ideas or requests - mail me at rdacosta@redhat.com
If you fancy contributing:
Create a branch -> Create a merge request -> Assign me as a reviewer.
- β General Linux Productivity
- βΈοΈ OpenShift Courses
- π€ Ansible Ansible Courses
Requires Ansible to be installed.
git clone https://gitlab.com/rgdacosta/classroom_env.git
cd classroom_env
ansible-playbook playbook.yml
These settings benefit all users, regardless of technology focus.
| Alias | Description |
|---|---|
.., ... |
Navigate up 1 or 2 directories |
please |
Run last command with sudo |
decomment |
Strip comments from files |
avc |
Show AVC denials using ausearch + aureport |
mnt |
List mounted device filesystems |
pwgen |
Generate a random secure password |
| Function | Description |
|---|---|
mcd <dir> |
Make and cd into a directory |
pastebin <file> |
Upload file as GitLab public snippet (requires your API key |
gnb <branch> |
Create and push new git branch |
Shows the current OpenShift project when logged in:
[user@host folder (my-namespace)] $| Plugin | Description |
|---|---|
vim-airline |
Enhanced status/tabline |
indentLine |
Vertical indent guides |
vim-commentary |
Easy commenting/uncommenting |
ale |
Background linting |
vim-yaml-folds |
Smart YAML folding |
| Alias | Description |
|---|---|
al |
Admin Login i.e. oc login -u admin -p redhatocp https://api.ocp4.example.com:6443 |
dl |
Developer Login i.e. oc login -u developer -p developer https://api.ocp4.example.com:6443 |
ccl |
Central Cluster Login (ACS courses) i.e. oc login -u admin -p redhatocp https://api.ocp4.example.com:6443 |
lcl |
Local Cluster Login (ACM courses) i.e. oc login -u admin -p redhatocp https://api.ocp4.example.com:6443 |
mcl |
Managed Cluster Login (ACM courses) i.e. oc login -u admin -p redhatocp https://api.ocp4-mng.example.com:6443 |
vl |
Virtual Admin Login (OpenShift Virt courses) i.e. oc login -u vt-admin -p vt-redhatocp https://api.ocp4.example.com:6443 |
clustercheck |
Checks if OpenShift is ready to be used |
events |
Check the project events in chronological order. Usage events ${project_name} |
podsw |
Same as oc get pods -o wide -n ${project_name} |
ocd |
oc describe |
ocp |
oc project |
ocg |
oc get |
ocl |
oc logs |
showtaints |
Show node taints |
showpods |
Show all pods and where they are running |
showcapacity |
Show cluster compute capacity |
showallocatable |
Show allocatable compute capacity |
| Function | Description |
|---|---|
whohas <role> |
List all users/groups bound to a role |
whomembers <group> |
List members of an OpenShift group |
plogs <pod> |
Follow logs in current namespace |
Auto-generated in ~/.ssh/config:
Host vm/*
ProxyCommand virtctl port-forward --stdio=true %h %p
IdentityFile ~/.ssh/lab_rsa
User cloud-user
Host vmi/*
ProxyCommand virtctl port-forward --stdio=true %h %p
IdentityFile ~/.ssh/lab_rsa
User cloud-user
| Alias | Description |
|---|---|
ap |
Run Ansible playbook |
apsc |
Check playbook syntax |
av |
Show Ansible version |
acd |
Show Ansible config |
aig |
Graph inventory tree |
anr |
Navigator: run with stdout mode |
ansc |
Navigator: syntax check |
anch |
Navigator: check mode |
anv |
Navigator: version |
anig |
Navigator: inventory graph |
ansible-navigator:
execution-environment:
image: utility.lab.example.com/ee-supported-rhel8:latest
pull:
policy: missing- Displays vertical lines at each indent level
- Helps navigate YAML and Python visually
:IndentLinesToggleRecommended setting:
set expandtab shiftwidth=2 tabstop=2zM " Close all folds
zR " Open all folds
zc " Close current fold
zo " Open current fold
za " Toggle current foldSuggested .vimrc:
set foldmethod=expr
set foldexpr=yaml#foldexpr()
set foldlevel=99- Background linting for YAML, Ansible, Shell, etc.
- Works well with
yamllint,ansible-lint, andshellcheck
]e " Next error
[e " Previous error
:ALEFix " Auto-fix errors
:ALEInfo " Show ALE debug info
:ALELint " Force a manual recheckOptional .vimrc config:
let g:ale_linters = {
\ 'yaml': ['yamllint'],
\ 'ansible': ['ansible_lint'],
\}
let g:ale_fixers = {
\ 'yaml': ['prettier', 'yamlfmt'],
\}gcc " Toggle comment on current line
gc2j " Comment next 2 lines
gc " Comment in visual modeFeatures:
- Git branch
- Current file
- Errors/warnings (from ALE)
Recommended config:
let g:airline_theme='dark'
let g:airline_powerline_fonts = 1Navigation:
:bn " Next buffer
:bp " Previous buffer
:b# " Last buffer- Smart syntax highlighting and indent rules for Ansible playbooks
Suggested .vimrc:
syntax enable
filetype plugin indent on
set tabstop=2 shiftwidth=2 expandtabExample:
- name: Ensure package is installed
ansible.builtin.dnf:
name: vim
state: presentvim site.yml # Open file
zM # Collapse everything
zo # Open a section
gcc # Comment out a line
:ALEFix # Auto-fix errors| File | Purpose |
|---|---|
~/.vimrc |
Core Vim settings |
~/.nanorc |
Syntax highlighting for Nano |
~/.tmux.conf |
Tmux configuration |
~/.ansible-navigator.yml |
Execution environment config |
~/.config/monitors.xml |
Monitor resolution |
~/.local/share/applications/org.gnome.Terminal.desktop |
GNOME Terminal shortcut |