📅  最后修改于: 2023-12-03 14:44:07.798000             🧑  作者: Mango
The Shell-Bash
role is an Ansible role that installs and configures the Bash shell on target systems. This role is suitable for programmers who use Bash extensively and want to have a standardized Bash environment across multiple systems.
The following variables can be customized in the playbook to modify the behavior of the Shell-Bash
role:
bash_version
: Specifies the version of Bash to install (default: latest
)bash_options
: A dictionary of Bash options to set in the .bashrc
file (default: {}
)bash_aliases
: A dictionary of Bash aliases to set in the .bashrc
file (default: {}
)bash_environment
: A dictionary of environment variables to set in the .bashrc
file (default: {}
)Shell-Bash
role:- name: Configure Bash shell
hosts: servers
become: true
roles:
- role: Shell-Bash
- name: Configure Bash shell
hosts: servers
become: true
roles:
- role: Shell-Bash
bash_version: '5.0'
bash_options:
- name: 'histfilesize'
value: '10000'
- name: 'histappend'
value: 'yes'
bash_aliases:
- name: 'ls'
value: 'ls --color=auto'
- name: 'll'
value: 'ls -l'
bash_environment:
- name: 'PATH'
value: '/usr/local/bin:/usr/bin:/bin'
To install the latest version of Bash shell with default configurations, simply run the playbook:
ansible-playbook playbook.yml
To customize the Bash options, aliases, and environment variables, edit the playbook and modify the role variables accordingly.
This Ansible role is licensed under the MIT License.