fix wrong db definition - fix uninstall - fix when variable undefined
This commit is contained in:
parent
5b6a828540
commit
498037625a
@ -16,7 +16,7 @@ You can set a password and an ssh key.
|
|||||||
Set the username (this is the default):
|
Set the username (this is the default):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# db configuration setprop ansibleusers username libreschool
|
# db configuration setprop adminusers username libreschool
|
||||||
```
|
```
|
||||||
|
|
||||||
The default password is **"LibreSchool,1234"**.
|
The default password is **"LibreSchool,1234"**.
|
||||||
@ -28,13 +28,13 @@ Set the password (must be hashed, see [here](https://docs.ansible.com/ansible/la
|
|||||||
localhost | SUCCESS => {
|
localhost | SUCCESS => {
|
||||||
"msg": "$6$S8BJ2Bbc26fRtExf$hNjphQ2HhbeiKLhPOdHttx6vWZwB90KgeinpREGrgcOHW2qYxf9s/csC7LFoENskhzwXK0wcWV3X9rPTC57Vu."
|
"msg": "$6$S8BJ2Bbc26fRtExf$hNjphQ2HhbeiKLhPOdHttx6vWZwB90KgeinpREGrgcOHW2qYxf9s/csC7LFoENskhzwXK0wcWV3X9rPTC57Vu."
|
||||||
}
|
}
|
||||||
# db configuration setprop ansibleusers password '$6$S8BJ2Bbc26fRtExf$hNjphQ2HhbeiKLhPOdHttx6vWZwB90KgeinpREGrgcOHW2qYxf9s/csC7LFoENskhzwXK0wcWV3X9rPTC57Vu.'
|
# db configuration setprop adminusers password '$6$S8BJ2Bbc26fRtExf$hNjphQ2HhbeiKLhPOdHttx6vWZwB90KgeinpREGrgcOHW2qYxf9s/csC7LFoENskhzwXK0wcWV3X9rPTC57Vu.'
|
||||||
```
|
```
|
||||||
|
|
||||||
Set an ssh key:
|
Set an ssh key:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# db configuration setprop ansibleusers sshkey "$(cat ~/.ssh/id_rsa.pub)"
|
# db configuration setprop adminusers sshkey "$(cat ~/.ssh/id_rsa.pub)"
|
||||||
```
|
```
|
||||||
|
|
||||||
## TODO / ideas ##
|
## TODO / ideas ##
|
||||||
|
@ -34,6 +34,7 @@ echo "%doc COPYING" >> %{name}-%{version}-%{release}
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
/etc/e-smith/events/actions/initialize-default-databases
|
||||||
/sbin/e-smith/expand-template /etc/ansible/reconfigure_clients.yml
|
/sbin/e-smith/expand-template /etc/ansible/reconfigure_clients.yml
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
@ -42,6 +43,7 @@ echo "%doc COPYING" >> %{name}-%{version}-%{release}
|
|||||||
#fi
|
#fi
|
||||||
if [ "$1" = 0 ]; then
|
if [ "$1" = 0 ]; then
|
||||||
#uninstallation
|
#uninstallation
|
||||||
|
/sbin/e-smith/db configuration delete adminusers
|
||||||
/sbin/e-smith/expand-template /etc/ansible/reconfigure_clients.yml
|
/sbin/e-smith/expand-template /etc/ansible/reconfigure_clients.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2,20 +2,20 @@
|
|||||||
|
|
||||||
- name: Create Admin user
|
- name: Create Admin user
|
||||||
user:
|
user:
|
||||||
name: "{{ esmith.ansibleusers.username }}"
|
name: "{{ esmith.adminusers.username }}"
|
||||||
groups: adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare
|
groups: adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare
|
||||||
append: yes
|
append: yes
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Set Admin password
|
- name: Set Admin password
|
||||||
user:
|
user:
|
||||||
name: "{{ esmith.ansibleusers.username }}"
|
name: "{{ esmith.adminusers.username }}"
|
||||||
password: "{{ esmith.ansibleusers.password }}"
|
password: "{{ esmith.adminusers.password }}"
|
||||||
when: esmith.ansibleusers.password != ""
|
when: (esmith.adminusers.password is defined) and (esmith.adminusers.password|length > 0)
|
||||||
|
|
||||||
- name: Set authorized_key
|
- name: Set authorized_key
|
||||||
authorized_key:
|
authorized_key:
|
||||||
user: "{{ esmith.ansibleusers.username }}"
|
user: "{{ esmith.adminusers.username }}"
|
||||||
state: present
|
state: present
|
||||||
key: "{{ esmith.ansibleusers.sshkey }}"
|
key: "{{ esmith.adminusers.sshkey }}"
|
||||||
when: esmith.ansibleusers.sshkey != ""
|
when: (esmith.adminusers.sshkey is defined) and (esmith.adminusers.sshkey|length > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user