Commit 23f0eef9 authored by Julien Muchembled's avatar Julien Muchembled

playbook: remove everything related to legacy re6stnet

parent c0a3b524
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars:
- computer_name: noname
- slapostoken: notoken
vars_files:
- settings/vifib.yml
roles:
- {role: re6stnet-upgrader}
---
- name: restart re6stnet
service: name=re6stnet state=restarted
---
- name: Install GPG
command: gpg --keyserver keys.gnupg.net --recv-keys 0990BF79AC87AE42AE5329074C23BE591A716324
when: ansible_distribution == "Debian"
- name: Install Debian 7 repository key
shell: gpg --export 1A716324 | apt-key add -
when: ansible_distribution == "Debian"
- name: Install Debian 7 repository
apt_repository: repo='deb http://git.erp5.org/dist/deb ./' state=present
when: ansible_distribution == "Debian"
- name: Install re6stnet package
apt: name=babeld=1.5.1-nxd2 state=present update_cache=yes
when: ansible_distribution == "Debian"
- name: Install re6stnet package
apt: name=re6stnet state={{ package_state }} update_cache=yes
when: ansible_distribution == "Debian"
- name: Check if configuration exists already
stat: path=/etc/re6stnet/re6stnet.conf
register: re6stnet_conf
- name: Configure Re6st with re6st-conf
shell: "re6st-conf --registry {{ re6st_registry_url }} -r title {{ computer_name }} -d /etc/re6stnet --anonymous"
when: ansible_distribution == "Debian" and re6stnet_conf.stat.exists == False and "{{ computer_name }}" != "noname"
- name: Start re6stnet service
service: name=re6stnet state=started enabled=yes
when: ansible_distribution == "Debian" and re6stnet_conf.stat.exists == True
- name: Add table 0
lineinfile: dest=/etc/re6stnet/re6stnet.conf line="table 0"
notify:
- restart re6stnet
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
mQGiBE9rM7ARBACILnCus7kJJtRKskvLcQVl1/cIF241w1XSeK23HHn/lpKjNmQ8
C6Uaqe4RI6aBMtJq7/9pcoq165Cz+fjW5xJYRdOTCJV+8gVCeXeJ1juAxZ2cU5NB
uAJ/7rG9mu2WgtSO8s5O8Hihpmn8Z/xEnYn+Fh45lG3u9+Lkum/WMSJ+mwCg1Jw3
P2T+dffvvWrZgvfacWz0uEMD/2M+2B9XJ0Ga4Z+yVuU57CvsaHJMGnPVnwsgCu8u
KIvkawiOg/HzNgIj88yETu0Q8HhuwfbdusRfv22MGmxvqvLGDGUSkkzQ/bev2vSc
fQAerKe2+BAV3QdPWhsVh2OTLEgDn7j+qewxih2+l6ASATs++6VX3JPuISKi5XMV
1aAvA/4vyG9evJ6DlAxfd235t3LUsYSmzKa5/1Wv4bVfAQXism4oGS4vygaTFqs7
tsBitWSmp+Jo7Fc7a5QRX/yL3uyDkXBB7NLPmYitFT5OvcdKg4U0fHigWxhzl8Xs
GMQZrlokbwJ/JxLlB1xYmdotfEYCwMJYc9momYg21FvMPfFu9rRCaG9tZTpWSUZJ
Qm5leGVkaSBPQlMgUHJvamVjdCA8aG9tZTpWSUZJQm5leGVkaUBidWlsZC5vcGVu
c3VzZS5vcmc+iGYEExECACYFAlOMizICGwMFCQhAB4IGCwkIBwMCBBUCCAMEFgID
AQIeAQIXgAAKCRAutNL5lKY5h3y4AJ4qgG9vVq7jPWW+oiFlO+xW9X7YrgCgs/oW
2c0IgUcwyXKNlbSYqGyu0l2IRgQTEQIABgUCT2szsAAKCRA7MBG3a51lI7sdAJ9q
/+6D3FndEZieHpJw/kG1eZLu/ACeKk0hcqg9zrFwj21oBr96kOBXCTs=
=8ciq
-----END PGP PUBLIC KEY BLOCK-----
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE peer (
prefix TEXT PRIMARY KEY NOT NULL,
address TEXT NOT NULL);
CREATE TABLE config (
name TEXT PRIMARY KEY NOT NULL,
value);
INSERT INTO "peer" VALUES('0000000000000000','85.118.38.162,1194,udp;85.118.38.162,1194,tcp');
INSERT INTO "peer" VALUES('0000000000000100','188.165.197.168,1194,tcp');
COMMIT;
[home_VIFIBnexedi]
name=SlapOS-Node (CentOS_CentOS-6)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6//repodata/repomd.xml.key
enabled=1
[home_VIFIBnexedi]
name=SlapOS-Node (CentOS_7)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_7/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_7//repodata/repomd.xml.key
enabled=1
[home_VIFIBnexedi]
name=SlapOS-Node (Fedora_20)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/VIFIBnexedi/Fedora_20/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/VIFIBnexedi/Fedora_20//repodata/repomd.xml.key
enabled=1
[home_VIFIBnexedi]
name=SlapOS-Node (Fedora_21)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/VIFIBnexedi/Fedora_21/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/VIFIBnexedi/Fedora_21//repodata/repomd.xml.key
enabled=1
---
- apt_key:
data: "{{ lookup('file', 'key_2EB4D2F994A63987.gpg') }}"
- name: Install vifib package repository
apt_repository:
repo: "deb http://download.opensuse.org/repositories/home:/VIFIBnexedi/Debian_{{ ansible_distribution_major_version }}.0 ./"
state: present
update_cache: yes
- name: Purge old re6stnet package
apt: name=re6stnet state=absent purge=yes
- include: fill_cache.yml
- name: Install re6st-node package
apt: name=re6st-node state=latest
---
- copy:
src: re6st_db_create.sql
dest: /tmp/
owner: root
group: root
mode: 0644
- file: path=/var/lib/re6stnet owner=root group=root mode=0755 state=directory
- name: Create new cache
shell: sqlite3 /var/lib/re6stnet/cache.db < /tmp/re6st_db_create.sql && rm /tmp/re6st_db_create.sql creates=/var/lib/re6stnet/cache.db
- name: Fill new cache
shell: if [ $(wc -l /var/lib/re6stnet/cache.db) -gt 0]; then sqlite3 -noheader -csv /var/lib/re6stnet/cache.db ".import {{ export_csv.stdout }} peer"; fi
---
- command: mktemp
register: export_csv
- name: Backup re6st certificates
command: cp -r /etc/re6stnet /etc/re6stnet.back creates=/etc/re6stnet.back removes=/etc/re6stnet
- apt: name=sqlite3 state=present update_cache=yes
when: ansible_os_family == "Debian"
- yum: name=sqlite state=present update_cache=yes
when: ansible_os_family == "Centos" or ansible_os_family == "RedHat"
- name: Dump cache
shell: sqlite3 -noheader -csv /var/lib/re6stnet/peers.db "select * from peer;" > {{ export_csv.stdout }} removes=/var/lib/re6stnet/peers.db
- include: debian.yml
when: ansible_os_family == "Debian"
- include: rhel.yml
when: ansible_os_family == "Centos" or ansible_os_family == "RedHat"
- name: Enable re6stnet service
service: name=re6stnet enabled=yes
- command: rm {{ export_csv.stdout }}
---
- name: Install vifib package repository
copy:
src: vifib_{{ ansible_distribution|lower }}{{ ansible_distribution_major_version }}.repo
dest: /etc/yum.repos.d/
owner: root
group: root
mode: 0644
- name: Purge old re6stnet package
yum: name=re6stnet state=absent
- include: fill_cache.yml
- name: Install re6st-node package
yum: name=re6st-node update_cache=yes state=latest
- name: Restart re6stnet service
service: name=re6stnet state=restarted
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment