Adapt dependency playbook to work with cent 7+8

Fix bug in bashrc ps1
This commit is contained in:
Ethan Paul 2019-11-23 21:04:29 -05:00
parent 4ae14c54dc
commit 3dc96bbf4d
2 changed files with 30 additions and 5 deletions

View File

@ -1,12 +1,27 @@
--- ---
- hosts: all - name: Check meta environment
name: Ansible python bindings hosts: all
tags: tags:
- always - always
- initialize - initialize
tasks: tasks:
- name: Install CentOS python bindings - name: Check required operating system
when: ansible_distribution == "CentOS" when: required_os is defined
assert:
that:
- required_os.split("_")[0] == ansible_distribution | lower
- required_os.split("_")[1] == ansible_distribution_major_version
fail_msg: "Host does not meet required OS specified"
success_msg: "Required OS validation succeeded"
- name: Ansible python bindings
hosts: all
tags:
- always
- initialize
tasks:
- name: Install CentOS 8 python bindings
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "8"
become: true become: true
dnf: dnf:
state: latest state: latest
@ -15,6 +30,16 @@
- python3-policycoreutils - python3-policycoreutils
- python3-firewall - python3-firewall
- name: Install CentoOS 7 python bindings
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
become: true
yum:
state: latest
name:
- libselinux-python
- policycoreutils-python
- python3-firewall
- name: Install Fedora python bindings - name: Install Fedora python bindings
when: ansible_distribution == "Fedora" when: ansible_distribution == "Fedora"
become: true become: true

View File

@ -58,4 +58,4 @@ alias date='/usr/bin/date --iso-8601=seconds'
alias whatismyip='curl https://icanhazip.com/' alias whatismyip='curl https://icanhazip.com/'
export rc=/home/$USERNAME/.bashrc export rc=/home/$USERNAME/.bashrc
export PS1="\[\e[0;97m\]\[\e[37m\e[1m]\]\u\[\e[1;94m\]@\[\e[94m\]\H\[\e[0;33m\]$(parse_git_branch) \[\e[37m\]\w\[\e[33m\] \[\e[0;97m\]$\[\e[0m\] " export PS1="\[\e[0;97m\]\[\e[37m\e[1m\]\u\[\e[1;94m\]@\[\e[94m\]\H\[\e[0;33m\]$(parse_git_branch) \[\e[37m\]\w\[\e[33m\] \[\e[0;97m\]$\[\e[0m\] "