working on profile.d/ansible-venv.sh
This commit is contained in:
+36
-5
@@ -23,12 +23,12 @@
|
||||
|
||||
- name: bootstrap
|
||||
hosts: all
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Install bootstrap packages
|
||||
ansible.builtin.apt:
|
||||
become: yes
|
||||
state: latest
|
||||
pkg:
|
||||
- bash
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
- name: Make sure hpf-sudo group exists
|
||||
ansible.builtin.group:
|
||||
become: yes
|
||||
name: hpf-sudo
|
||||
state: present
|
||||
system: true
|
||||
@@ -47,6 +48,7 @@
|
||||
|
||||
- name: Make sure hpf-sudo-np group exists
|
||||
ansible.builtin.group:
|
||||
become: yes
|
||||
name: hpf-sudo-np
|
||||
state: present
|
||||
system: true
|
||||
@@ -54,6 +56,7 @@
|
||||
|
||||
- name: Copy over /etc/sudoers.d/hpf
|
||||
ansible.builtin.copy:
|
||||
become: yes
|
||||
src: etc_sudoers_d_hpf
|
||||
dest: /etc/sudoers.d/hpf
|
||||
owner: root
|
||||
@@ -62,8 +65,38 @@
|
||||
backup: true
|
||||
validate: /usr/sbin/visudo -csf %s
|
||||
|
||||
|
||||
#### .profile.d should be in SKEL directory - look it up
|
||||
|
||||
- name: Make sure .profile.d directory exists
|
||||
ansible.builtin.file:
|
||||
become: true
|
||||
path: /etc/skel/.profile.d
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rwx,go=
|
||||
|
||||
|
||||
#### ansible-venv.sh should be in SKEL directory - look it up
|
||||
|
||||
- name: Copy over ansible-venv.sh
|
||||
ansible.builtin.copy:
|
||||
become: true
|
||||
src: profile_d_ansible_venv_sh
|
||||
dest: /etc/skel/.profile.d/ansible-pull.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rwx,go=
|
||||
backup: true
|
||||
|
||||
|
||||
#### .profile
|
||||
|
||||
|
||||
- name: Make sure hpf-ans group exists
|
||||
ansible.builtin.group:
|
||||
become: yes
|
||||
name: hpf-ans
|
||||
state: present
|
||||
system: true
|
||||
@@ -71,6 +104,7 @@
|
||||
|
||||
- name: Make sure hpf-ans user exists
|
||||
ansible.builtin.user:
|
||||
become: yes
|
||||
name: hpf-ans
|
||||
state: present
|
||||
system: true
|
||||
@@ -86,14 +120,12 @@
|
||||
name: pip
|
||||
virtualenv: $HOME/.ansible-venv
|
||||
extra_args: --upgrade
|
||||
become: no
|
||||
|
||||
- name: Install latest version of ansible in .ansible-venv
|
||||
ansible.builtin.pip:
|
||||
name: ansible
|
||||
virtualenv: $HOME/.ansible-venv
|
||||
extra_args: "--upgrade"
|
||||
become: no
|
||||
|
||||
- name: Make sure bin directory exists
|
||||
ansible.builtin.file:
|
||||
@@ -102,7 +134,6 @@
|
||||
owner: hpf-ans
|
||||
group: hpf-ans
|
||||
mode: u=rwx,go=
|
||||
become: no
|
||||
|
||||
- name: Copy over bin/ansible-pull.sh
|
||||
ansible.builtin.copy:
|
||||
@@ -112,10 +143,10 @@
|
||||
group: hpf-ans
|
||||
mode: u=rwx,go=
|
||||
backup: true
|
||||
become: no
|
||||
|
||||
- name: Make sure log directory exists
|
||||
ansible.builtin.file:
|
||||
become: yes
|
||||
path: /var/log/ansible-pull.sh
|
||||
state: directory
|
||||
owner: hpf-ans
|
||||
|
||||
+2
-10
@@ -1,18 +1,10 @@
|
||||
|
||||
|
||||
|
||||
* create bootstrap, production, development branches
|
||||
* create production, development branches
|
||||
* have bootstrap.sh get ansible_pull_branch variable value
|
||||
|
||||
* have the following appended to .profile
|
||||
if [ -d "$HOME/.profile.d" ] ; then
|
||||
for profile_script in $HOME/.profile.d/*.sh ; do
|
||||
. "${profile_script}"
|
||||
done
|
||||
fi
|
||||
* create ~/.profile.d
|
||||
* create ~/.profile.d/ansible-venv.sh
|
||||
ansible.builtin.blockinfile
|
||||
* have bootstrap.yml use ansible.builtin.blockinfile to maintain /etc/skel/.profile
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user