Managing local installation of ansible in case of missing connectivity on server.
This commit is contained in:
parent
481f1f84d5
commit
2b606f66b5
29
roles/kickstart/files/ppa-ansible.gpg
Normal file
29
roles/kickstart/files/ppa-ansible.gpg
Normal file
@ -0,0 +1,29 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1
|
||||
|
||||
mQINBFOXbTABEADKLcY3MYZyHIiCEu8cQ+0UzxZolTYZf8xZ06/d8xzUW/UBPTLV
|
||||
x/40IzWJEZU87GCYVXUhdYXECrFQKQOOEWQswBxOt26/g0nIrU0edZ9cCZ9o9+ZO
|
||||
sKDcScWNxWeclLr2+YHdmX9eph+2p+zIPmhNJaaWV6/bSo1fBi7ganZFRAc13zO8
|
||||
jtQsYyIeoAFwjt1vbk9CifdFhEchRVbwvZYhZDWfBZjhZ15UOunjo47gEkpK0PsW
|
||||
HY5N3/c75pGMwMTCjHMKno6KFzhdKLaz/QgbNnpy1aMkA/LITeU6Pgg6iqofrSY3
|
||||
Fx73MCAb8EEytvSV/65wztKzexHjGYxhm5ygoET5tPyXciX0+XzojkZAHzUEeT5z
|
||||
4kgL6OLyn+JQAyRDNnOJEkYmvwQveZuUjsYUkgc5DJdg6w7lTgQHWObOENpXls3B
|
||||
DnphA4DJyc0PQODCxdSZo4ZXMLn5lE/0qvAJ6g/wntY/ee/vRKwy9iDMOWQvihTI
|
||||
Y/L70/TnE4qZdaNbOJEvW59LT6GBTrcU1MX2fS5hU/mQa2CNixSVZG98rba3tfNa
|
||||
LDDNqivkcxtWryEWd0giBzzUS+MhtxhHm77YgxNVyyFn8bXb25/W+Jq+VvWWx2KD
|
||||
3ZwVD37X8wIBRLVozoH0jHVW7jKTnf2z+D6FCM+pVlm8zV1upXbHbdaRqwARAQAB
|
||||
tB9MYXVuY2hwYWQgUFBBIGZvciBBbnNpYmxlLCBJbmMuiQI4BBMBAgAiBQJTl20w
|
||||
AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCTxKP9e7nDZwzdD/9yFq+3
|
||||
ptLyWP1JN3RXsvTIJLhhjOqMMJCOocV0G3slHeUtdIDmvd2RaS8PeFNSd9QFbUzk
|
||||
a7pBXec3a7kgEVorty2/+cZSpEVHT26oAbJnoH7E1YGii8bbnk9LqOCF/nLpasEq
|
||||
PKqtVzXz+vGB7G0ox8qmRm6JynrMeLBftYemxJ8e4fii6APJxE6FPz/AvgcN3BtB
|
||||
guseFwcga6lGcmp0JLofGhTbejfS9dW9bnCFJBtRfzUVd+Cb8aYuzV5zgCJgqOBJ
|
||||
Hf0L6xDwn8UuzRfi0MWzEskuC/KxUJqVHMuTaLdrSeP1/czompetbsSHTfDklf/p
|
||||
4EbSM9VqZFiKr17we0LdigAEv2JnL2Qj0oN3eRNU0sDJ3kZvh5qhnteNgSRM/el0
|
||||
Sly+34CRZzX25vd+pOTgwK6VFx3wvWfqn3pVNT9ASNalhogFXuBY2ukYJaiUTPsS
|
||||
R4+KHiD3eIhWyayBGP+GRvGb5dVC29k4CjLvQM9lISmZrrxGmMGoV9S1dh7siZYE
|
||||
CaVW0nKI95d6bBHaKH1g5HJ7NEsVTwf8LRY/FFpLsEPVw4HNVqqqwhuJnSW70WQ3
|
||||
blh0RIX/+z9hAla+M0kix7r0lS89ZBdTgwPuiCrkPRpoxi06ah/Q62uP3ZN4+dew
|
||||
1sBZdaC9kaKdOOWTqArVnaPObQgUUJFhY9wUsA==
|
||||
=qlCh
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -63,3 +63,16 @@
|
||||
src: post-docenti-ks.sh
|
||||
dest: /var/lib/nethserver/ibay/ks/post-docenti-ks.sh
|
||||
sudo: yes
|
||||
|
||||
- name: Copio la chiave GPG del repository ansible per installazione locale
|
||||
copy:
|
||||
src: ppa-ansible.gpg
|
||||
dest: /var/lib/nethserver/ibay/ks/ppa-ansible.gpg
|
||||
sudo: yes
|
||||
|
||||
- name: Copio la configurazione del repo di ansible per installazione locale
|
||||
template:
|
||||
src: ansible-ansible-trusty.list
|
||||
dest: /var/lib/nethserver/ibay/ks/ansible-ansible-trusty.list
|
||||
sudo: yes
|
||||
|
||||
|
2
roles/kickstart/templates/ansible-ansible-trusty.list
Normal file
2
roles/kickstart/templates/ansible-ansible-trusty.list
Normal file
@ -0,0 +1,2 @@
|
||||
deb http://{{ ansible_local.domain.mirrorpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
||||
# deb-src http://{{ ansible_local.domain.mirrorpath }}ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
@ -5,11 +5,19 @@ TARGETHOSTNAME=$(wget -qO- http://{{ ansible_local.domain.serverfqdn }}:3000/wha
|
||||
echo $TARGETHOSTNAME > /etc/hostname
|
||||
sed -i "s/kickseed/$TARGETHOSTNAME/g" /etc/hosts
|
||||
|
||||
if ping -c4 8.8.8.8 >/dev/null 2>&1; then
|
||||
# Installo l'ultimo ansible per ansible-pull
|
||||
export https_proxy=https://{{ ansible_local.domain.serverip }}:3128
|
||||
add-apt-repository -y ppa:ansible/ansible
|
||||
apt-get update && apt-get install -y ansible
|
||||
unset https_proxy
|
||||
else
|
||||
# Adding ansible manually from local
|
||||
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ppa-ansible.gpg -O /tmp/ppa-ansible.gpg
|
||||
apt-key add /tmp/ppa-ansible.gpg && rm -f /tmp/ppa-ansible.gpg
|
||||
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-ansible-trusty.list -O /etc/apt/sources.list.d/ansible-ansible-trusty.list
|
||||
apt-get update && apt-get install -y ansible
|
||||
fi
|
||||
|
||||
# Creo directory dipendenti
|
||||
install -d -o root -g root /var/lib/{{ ansible_local.domain.domainfull }}/config
|
||||
|
@ -5,11 +5,19 @@ TARGETHOSTNAME=$(wget -qO- http://{{ ansible_local.domain.serverfqdn }}:3000/wha
|
||||
echo $TARGETHOSTNAME > /etc/hostname
|
||||
sed -i "s/kickseed/$TARGETHOSTNAME/g" /etc/hosts
|
||||
|
||||
if ping -c4 8.8.8.8 >/dev/null 2>&1; then
|
||||
# Installo l'ultimo ansible per ansible-pull
|
||||
export https_proxy=https://{{ ansible_local.domain.serverip }}:3128
|
||||
add-apt-repository -y ppa:ansible/ansible
|
||||
apt-get update && apt-get install -y ansible
|
||||
unset https_proxy
|
||||
else
|
||||
# Adding ansible manually from local
|
||||
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ppa-ansible.gpg -O /tmp/ppa-ansible.gpg
|
||||
apt-key add /tmp/ppa-ansible.gpg && rm -f /tmp/ppa-ansible.gpg
|
||||
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-ansible-trusty.list -O /etc/apt/sources.list.d/ansible-ansible-trusty.list
|
||||
apt-get update && apt-get install -y ansible
|
||||
fi
|
||||
|
||||
# Creo directory dipendenti
|
||||
install -d -o root -g root /var/lib/{{ ansible_local.domain.domainfull }}/config
|
||||
|
@ -63,6 +63,10 @@ deb-i386 http://security.ubuntu.com/ubuntu trusty-security main restricted unive
|
||||
deb-amd64 http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
|
||||
|
||||
# Ansible
|
||||
deb-i386 http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
||||
deb-amd64 http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
|
||||
|
||||
clean http://archive.ubuntu.com/ubuntu
|
||||
clean http://extras.ubuntu.com/ubuntu
|
||||
clean http://archive.canonical.com
|
||||
|
Loading…
x
Reference in New Issue
Block a user