From ae254b596f6e12601e0f6b206d09b87e5a9b480d Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Wed, 26 Sep 2018 11:46:03 +0200 Subject: users: merge root_env into this role --- roles/root_env/files/bash_profile.sh | 1 - roles/root_env/files/bashrc.sh.j2 | 34 --------------------------------- roles/root_env/tasks/main.yml | 18 ----------------- roles/space_server/meta/main.yml | 1 - roles/users/files/root/bash_profile.sh | 1 + roles/users/tasks/main.yml | 4 ++++ roles/users/tasks/root.yml | 18 +++++++++++++++++ roles/users/templates/root/bashrc.sh.j2 | 34 +++++++++++++++++++++++++++++++++ 8 files changed, 57 insertions(+), 54 deletions(-) delete mode 100644 roles/root_env/files/bash_profile.sh delete mode 100644 roles/root_env/files/bashrc.sh.j2 delete mode 100644 roles/root_env/tasks/main.yml create mode 100644 roles/users/files/root/bash_profile.sh create mode 100644 roles/users/tasks/root.yml create mode 100644 roles/users/templates/root/bashrc.sh.j2 diff --git a/roles/root_env/files/bash_profile.sh b/roles/root_env/files/bash_profile.sh deleted file mode 100644 index 3ee6b29..0000000 --- a/roles/root_env/files/bash_profile.sh +++ /dev/null @@ -1 +0,0 @@ -. "$HOME/.bashrc" diff --git a/roles/root_env/files/bashrc.sh.j2 b/roles/root_env/files/bashrc.sh.j2 deleted file mode 100644 index bcc4ddb..0000000 --- a/roles/root_env/files/bashrc.sh.j2 +++ /dev/null @@ -1,34 +0,0 @@ -# if not running interactively, don't do anything -[[ $- != *i* ]] && return - -export PS1='\[\e[1;31m\]\u\[\e[00m\]@\[\e[0;31m\]\h\[\e[1;34m\]\w\[\e[00m\]\$ ' -unset PROMPT_COMMAND - -# directory listing -eval "$(dircolors -b)" -alias ls='ls --color=auto -F' -alias ll='ls -Ahl' - -# some more alias to avoid making mistakes: -alias rm='rm -ri' -alias cp='cp -rid' -alias mv='mv -i' - -# editor -export EDITOR='vim' -alias vi='vim' - -# network -alias ip6='ip -6' -{% if ansible_service_mgr == 'systemd' %} - -# systemd -alias start='systemctl start' -alias stop='systemctl stop' -alias restart='systemctl restart' -alias status='systemctl status' -alias cgls='systemd-cgls' -alias cgtop='systemd-cgtop' -{% endif %} - -cd diff --git a/roles/root_env/tasks/main.yml b/roles/root_env/tasks/main.yml deleted file mode 100644 index 7b20fd1..0000000 --- a/roles/root_env/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: root .bash_profile - copy: - dest: '/root/.bash_profile' - src: files/bash_profile.sh - owner: root - group: root - mode: 0644 - -- name: root .bashrc - template: - dest: '/root/.bashrc' - src: files/bashrc.sh.j2 - owner: root - group: root - mode: 0644 - -# vim: set ts=2 sw=2 et: diff --git a/roles/space_server/meta/main.yml b/roles/space_server/meta/main.yml index d2839f1..2739dff 100644 --- a/roles/space_server/meta/main.yml +++ b/roles/space_server/meta/main.yml @@ -1,7 +1,6 @@ --- dependencies: - role: fedora - - role: root_env - role: users # vim: set ts=2 sw=2 et: diff --git a/roles/users/files/root/bash_profile.sh b/roles/users/files/root/bash_profile.sh new file mode 100644 index 0000000..3ee6b29 --- /dev/null +++ b/roles/users/files/root/bash_profile.sh @@ -0,0 +1 @@ +. "$HOME/.bashrc" diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml index 2cc6cd1..8d4acfa 100644 --- a/roles/users/tasks/main.yml +++ b/roles/users/tasks/main.yml @@ -1,4 +1,8 @@ --- +- import_tasks: root.yml + tags: + - users + - root - import_tasks: esmil.yml tags: - users diff --git a/roles/users/tasks/root.yml b/roles/users/tasks/root.yml new file mode 100644 index 0000000..e5b3b45 --- /dev/null +++ b/roles/users/tasks/root.yml @@ -0,0 +1,18 @@ +--- +- name: root .bash_profile + copy: + dest: '/root/.bash_profile' + src: root/bash_profile.sh + owner: root + group: root + mode: 0644 + +- name: root .bashrc + template: + dest: '/root/.bashrc' + src: root/bashrc.sh.j2 + owner: root + group: root + mode: 0644 + +# vim: set ts=2 sw=2 et: diff --git a/roles/users/templates/root/bashrc.sh.j2 b/roles/users/templates/root/bashrc.sh.j2 new file mode 100644 index 0000000..bcc4ddb --- /dev/null +++ b/roles/users/templates/root/bashrc.sh.j2 @@ -0,0 +1,34 @@ +# if not running interactively, don't do anything +[[ $- != *i* ]] && return + +export PS1='\[\e[1;31m\]\u\[\e[00m\]@\[\e[0;31m\]\h\[\e[1;34m\]\w\[\e[00m\]\$ ' +unset PROMPT_COMMAND + +# directory listing +eval "$(dircolors -b)" +alias ls='ls --color=auto -F' +alias ll='ls -Ahl' + +# some more alias to avoid making mistakes: +alias rm='rm -ri' +alias cp='cp -rid' +alias mv='mv -i' + +# editor +export EDITOR='vim' +alias vi='vim' + +# network +alias ip6='ip -6' +{% if ansible_service_mgr == 'systemd' %} + +# systemd +alias start='systemctl start' +alias stop='systemctl stop' +alias restart='systemctl restart' +alias status='systemctl status' +alias cgls='systemd-cgls' +alias cgtop='systemd-cgtop' +{% endif %} + +cd -- cgit v1.2.1