From d8a7729358a2fd3b911022e45d0197fda3e5da94 Mon Sep 17 00:00:00 2001 From: boom2 Date: Fri, 8 Dec 2023 14:12:33 -0500 Subject: - add exeriments for: - roles - variables - inventory changes - config changes --- home/.ansible/group_vars/all | 1 + home/.ansible/host_vars/localhost | 1 + home/.ansible/hosts | 10 +++++- home/.ansible/hosts~ | 5 +++ .../.ansible/roles/bash_config/files/.bash_aliases | 10 ++++++ .../.ansible/roles/bash_config/files/.bash_profile | 3 ++ home/.ansible/roles/bash_config/files/.bashrc | 38 ++++++++++++++++++++++ home/.ansible/roles/bash_config/tasks/main.yml | 21 ++++++++++++ .../roles/bash_config_old/files/.bash_aliases | 10 ++++++ .../roles/bash_config_old/files/.bash_profile | 3 ++ home/.ansible/roles/bash_config_old/files/.bashrc | 38 ++++++++++++++++++++++ home/.ansible/roles/bash_config_old/tasks/main.yml | 21 ++++++++++++ .../.ansible/roles/bash_config_old/tasks/main.yml~ | 24 ++++++++++++++ .../roles/bash_config_old/vars/localhost.yml | 3 ++ .../roles/bash_config_old/vars/localhost.yml~ | 4 +++ .../roles/bash_config_old/vars/otherhosts.yml | 3 ++ .../roles/bash_config_old/vars/otherhosts.yml~ | 4 +++ 17 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 home/.ansible/group_vars/all create mode 100644 home/.ansible/host_vars/localhost create mode 100644 home/.ansible/hosts~ create mode 100644 home/.ansible/roles/bash_config/files/.bash_aliases create mode 100644 home/.ansible/roles/bash_config/files/.bash_profile create mode 100644 home/.ansible/roles/bash_config/files/.bashrc create mode 100644 home/.ansible/roles/bash_config/tasks/main.yml create mode 100644 home/.ansible/roles/bash_config_old/files/.bash_aliases create mode 100644 home/.ansible/roles/bash_config_old/files/.bash_profile create mode 100644 home/.ansible/roles/bash_config_old/files/.bashrc create mode 100644 home/.ansible/roles/bash_config_old/tasks/main.yml create mode 100644 home/.ansible/roles/bash_config_old/tasks/main.yml~ create mode 100644 home/.ansible/roles/bash_config_old/vars/localhost.yml create mode 100644 home/.ansible/roles/bash_config_old/vars/localhost.yml~ create mode 100644 home/.ansible/roles/bash_config_old/vars/otherhosts.yml create mode 100644 home/.ansible/roles/bash_config_old/vars/otherhosts.yml~ (limited to 'home/.ansible') diff --git a/home/.ansible/group_vars/all b/home/.ansible/group_vars/all new file mode 100644 index 0000000..6f19ef0 --- /dev/null +++ b/home/.ansible/group_vars/all @@ -0,0 +1 @@ +prefix_dir: ~/ \ No newline at end of file diff --git a/home/.ansible/host_vars/localhost b/home/.ansible/host_vars/localhost new file mode 100644 index 0000000..a2e254c --- /dev/null +++ b/home/.ansible/host_vars/localhost @@ -0,0 +1 @@ +prefix_dir: ~/tmp/temp_files/ \ No newline at end of file diff --git a/home/.ansible/hosts b/home/.ansible/hosts index 81947e7..27b4d77 100644 --- a/home/.ansible/hosts +++ b/home/.ansible/hosts @@ -1,5 +1,13 @@ +# - you will need to define any variables before we define any stanzas +# https://docs.ansible.com/ansible/latest/inventory_guide/connection_details.html +# https://nixzie.com/run-ansible-playbook-locally/#Run_Ansible_Playbook_Locally_Using_Local_Action + + [test] 192.168.0.220 [dev] -192.168.0.220 \ No newline at end of file +192.168.0.220 + +localhost ansible_connection=local + diff --git a/home/.ansible/hosts~ b/home/.ansible/hosts~ new file mode 100644 index 0000000..81947e7 --- /dev/null +++ b/home/.ansible/hosts~ @@ -0,0 +1,5 @@ +[test] +192.168.0.220 + +[dev] +192.168.0.220 \ No newline at end of file diff --git a/home/.ansible/roles/bash_config/files/.bash_aliases b/home/.ansible/roles/bash_config/files/.bash_aliases new file mode 100644 index 0000000..37d8775 --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bash_aliases @@ -0,0 +1,10 @@ +# navigation +alias ls='/bin/ls $LS_OPTIONS' +alias ll='ls -al --color=auto' + +# applications +alias vi=/usr/bin/vim +alias mc='. /usr/share/mc/bin/mc-wrapper.sh' + +# git +alias gstat='git status' diff --git a/home/.ansible/roles/bash_config/files/.bash_profile b/home/.ansible/roles/bash_config/files/.bash_profile new file mode 100644 index 0000000..a6c2023 --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bash_profile @@ -0,0 +1,3 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi diff --git a/home/.ansible/roles/bash_config/files/.bashrc b/home/.ansible/roles/bash_config/files/.bashrc new file mode 100644 index 0000000..5d417ae --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bashrc @@ -0,0 +1,38 @@ +# execute our aliases +if [ -f ~/.bash_aliases ]; then +. ~/.bash_aliases +fi + +# history settings +## setting unlimited filesize and history size +export HISTFILESIZE= +export HISTSIZE= +export HISTCONTROL=erasedups:ignorespace:ignoredups + +# allows you to choose which standalone commands to drop from your history +export HISTIGNORE='pwd:exit:fg:bg:top:clear:history:ls:uptime:ll' + +# display timestamp before the history command entry +export HISTTIMEFORMAT='%F %T ' + +# https://cyb.org.uk/2021/05/03/bash-productivity.html +# http://mywiki.wooledge.org/BashFAQ/088 +PROMPT_COMMAND='history -a' +shopt -s histappend + +#setting prompt +# export PS1="\u@\h:\w\$ " +# export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " +export PS1="\n\[\033[11;33m\][\[\033[11;36m\]\D{%F} \t\[\033[11;33m\]][\[\033[11;36m\]\!\[\033[11;33m\]]\n[\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00;33m\]]\[\033[00m\]\n\$ " +export PS2="> " + +# the default editor +export EDITOR=vim + +# add color +eval `dircolors -b` + +# this function calls 'cd' to enter a directory and then immediately calls 'ls' +cdls() { + cd "$@" && ll; +} diff --git a/home/.ansible/roles/bash_config/tasks/main.yml b/home/.ansible/roles/bash_config/tasks/main.yml new file mode 100644 index 0000000..28a12c9 --- /dev/null +++ b/home/.ansible/roles/bash_config/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: copy '.bash_aliases' + ansible.builtin.copy: + src: .bash_aliases + dest: "{{ prefix_dir }}.bash_aliases" + mode: '0644' + tags: ['bash_aliases'] + +- name: copy '.bashrc' file with content + ansible.builtin.copy: + src: .bashrc + dest: "{{ prefix_dir }}.bashrc" + mode: '0644' + tags: ['bashrc'] + +- name: copy '.bash_profile' file with content + ansible.builtin.copy: + src: .bash_profile + dest: "{{ prefix_dir }}.bash_profile" + mode: '0644' + tags: ['bash_profile'] diff --git a/home/.ansible/roles/bash_config_old/files/.bash_aliases b/home/.ansible/roles/bash_config_old/files/.bash_aliases new file mode 100644 index 0000000..37d8775 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/files/.bash_aliases @@ -0,0 +1,10 @@ +# navigation +alias ls='/bin/ls $LS_OPTIONS' +alias ll='ls -al --color=auto' + +# applications +alias vi=/usr/bin/vim +alias mc='. /usr/share/mc/bin/mc-wrapper.sh' + +# git +alias gstat='git status' diff --git a/home/.ansible/roles/bash_config_old/files/.bash_profile b/home/.ansible/roles/bash_config_old/files/.bash_profile new file mode 100644 index 0000000..a6c2023 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/files/.bash_profile @@ -0,0 +1,3 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi diff --git a/home/.ansible/roles/bash_config_old/files/.bashrc b/home/.ansible/roles/bash_config_old/files/.bashrc new file mode 100644 index 0000000..5d417ae --- /dev/null +++ b/home/.ansible/roles/bash_config_old/files/.bashrc @@ -0,0 +1,38 @@ +# execute our aliases +if [ -f ~/.bash_aliases ]; then +. ~/.bash_aliases +fi + +# history settings +## setting unlimited filesize and history size +export HISTFILESIZE= +export HISTSIZE= +export HISTCONTROL=erasedups:ignorespace:ignoredups + +# allows you to choose which standalone commands to drop from your history +export HISTIGNORE='pwd:exit:fg:bg:top:clear:history:ls:uptime:ll' + +# display timestamp before the history command entry +export HISTTIMEFORMAT='%F %T ' + +# https://cyb.org.uk/2021/05/03/bash-productivity.html +# http://mywiki.wooledge.org/BashFAQ/088 +PROMPT_COMMAND='history -a' +shopt -s histappend + +#setting prompt +# export PS1="\u@\h:\w\$ " +# export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " +export PS1="\n\[\033[11;33m\][\[\033[11;36m\]\D{%F} \t\[\033[11;33m\]][\[\033[11;36m\]\!\[\033[11;33m\]]\n[\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00;33m\]]\[\033[00m\]\n\$ " +export PS2="> " + +# the default editor +export EDITOR=vim + +# add color +eval `dircolors -b` + +# this function calls 'cd' to enter a directory and then immediately calls 'ls' +cdls() { + cd "$@" && ll; +} diff --git a/home/.ansible/roles/bash_config_old/tasks/main.yml b/home/.ansible/roles/bash_config_old/tasks/main.yml new file mode 100644 index 0000000..28a12c9 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: copy '.bash_aliases' + ansible.builtin.copy: + src: .bash_aliases + dest: "{{ prefix_dir }}.bash_aliases" + mode: '0644' + tags: ['bash_aliases'] + +- name: copy '.bashrc' file with content + ansible.builtin.copy: + src: .bashrc + dest: "{{ prefix_dir }}.bashrc" + mode: '0644' + tags: ['bashrc'] + +- name: copy '.bash_profile' file with content + ansible.builtin.copy: + src: .bash_profile + dest: "{{ prefix_dir }}.bash_profile" + mode: '0644' + tags: ['bash_profile'] diff --git a/home/.ansible/roles/bash_config_old/tasks/main.yml~ b/home/.ansible/roles/bash_config_old/tasks/main.yml~ new file mode 100644 index 0000000..9cf3382 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/tasks/main.yml~ @@ -0,0 +1,24 @@ +--- +- name: copy '.bash_aliases' + ansible.builtin.copy: + src: ~/repos/ansible_repo/ansible-practice/system/.bash_aliases + dest: "~/.bash_aliases" +# dest: "~/tmp/temp_files/.bash_aliases" + mode: '0644' + tags: ['bash_aliases'] + +- name: Creating '.bashrc' file with content + ansible.builtin.copy: + src: ~/repos/ansible_repo/ansible-practice/system/.bashrc + dest: "~/.bashrc" +# dest: "~/tmp/temp_files/.bashrc" + mode: '0644' + tags: ['bashrc'] + +- name: Creating '.bash_profile' file with content + ansible.builtin.copy: + src: ~/repos/ansible_repo/ansible-practice/system/.bash_profile + dest: "~/.bash_profile" +# dest: "~/tmp/temp_files/.bash_profile" + mode: '0644' + tags: ['bash_profile'] diff --git a/home/.ansible/roles/bash_config_old/vars/localhost.yml b/home/.ansible/roles/bash_config_old/vars/localhost.yml new file mode 100644 index 0000000..c5727b6 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/vars/localhost.yml @@ -0,0 +1,3 @@ +--- +# vars for localhost +prefix_dir: ~/tmp/temp_files/ diff --git a/home/.ansible/roles/bash_config_old/vars/localhost.yml~ b/home/.ansible/roles/bash_config_old/vars/localhost.yml~ new file mode 100644 index 0000000..8828589 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/vars/localhost.yml~ @@ -0,0 +1,4 @@ +--- +- name: Set a variable for localhost + vars: + prefix_dir: ~/tmp/temp_files/ diff --git a/home/.ansible/roles/bash_config_old/vars/otherhosts.yml b/home/.ansible/roles/bash_config_old/vars/otherhosts.yml new file mode 100644 index 0000000..1fe8201 --- /dev/null +++ b/home/.ansible/roles/bash_config_old/vars/otherhosts.yml @@ -0,0 +1,3 @@ +--- +# vars for other hosts +prefix_dir: ~/ diff --git a/home/.ansible/roles/bash_config_old/vars/otherhosts.yml~ b/home/.ansible/roles/bash_config_old/vars/otherhosts.yml~ new file mode 100644 index 0000000..a54722c --- /dev/null +++ b/home/.ansible/roles/bash_config_old/vars/otherhosts.yml~ @@ -0,0 +1,4 @@ +--- +- name: Set a variable for other hosts + vars: + prefix_dir: ~/ -- cgit v1.2.3-54-g00ecf