Compare commits

..

1 Commits

Author SHA1 Message Date
chris f19b39112a ceph experiments 2020-02-07 13:09:42 +01:00
6 changed files with 20 additions and 72 deletions

View File

@ -5,5 +5,5 @@
- name: etcd configuration
template:
src: defaults-etcd.j2
dest: /etc/default/etcd
dest: /etc/defaults/etcd
notify: restart etcd

View File

@ -1,5 +0,0 @@
---
- name: restart rpcbind
service:
name: rpcbind
state: restarted

View File

@ -1,40 +1,4 @@
---
- name: install rpcbind
apt:
name: rpcbind
- name: disable rpcbind from the internet
iptables:
action: insert
chain: INPUT
comment: drop portmapper
in_interface: "!nodevpn"
jump: DROP
protocol: "{{item}}"
destination_port: "111"
with_items:
- tcp
- udp
- name: bind rpcbind to vpn ip
lineinfile:
create: yes
path: /etc/rpcbind.conf
line: "OPTIONS=-w -h {{wg_ip}}"
regexp: "^OPTIONS.*"
notify: restart rpcbind
- name: add vpn to hosts.allow
lineinfile:
path: /etc/hosts.allow
line: "rpcbind: 10.0.0.0/8"
regexp: "rpbcind.*"
notify: restart rpcbind
- name: block everyone
lineinfile:
path: /etc/hosts.deny
line: "rpcbind: ALL"
regexp: "rpcbind.*"
notify: restart rpcbind
- name: fire handlers
meta: flush_handlers
- name: install gluster package
apt:
name: glusterfs-server
@ -51,29 +15,25 @@
mount:
path: /mnt/gluster
src: /dev/sdb
opts: noatime
options: noatime
fstype: ext4
state: mounted
- name: bootstrap gluster cluster
block:
- name: gluster peers
gluster_peer:
nodes:
- node01
- node02
- node03
- name: gluster volume
gluster_volume:
name: data
replicas: 3
state: present
bricks: /mnt/gluster/data
start_on_create: yes
cluster:
- node01
- node02
- node03
when: ansible_nodename == "node01"
- name: gluster peers
gluster_peer:
nodes:
- node01
- node02
- node03
- name: gluster volume
gluster_volume:
name: data
replicas: 3
state: started
bricks: /mnt/gluster/data
cluster:
- node01
- node02
- node03
- name: gluster client package
apt:
name: glusterfs-client
@ -81,6 +41,6 @@
mount:
path: /data
src: "{{ansible_nodename}}:/data"
opts: noatime
options: noatime
fstype: glusterfs
state: mounted

View File

@ -10,8 +10,3 @@
dest: /etc/systemd/system/k3s.service
notify: start k3s
- name: enable and start k3s
systemd:
daemon_reload: yes
enabled: yes
name: k3s
state: restarted

View File

@ -5,4 +5,4 @@ After=network-online.target
[Service]
Environment=K3S_TOKEN={{k3s_token}}
Environment=K3S_DATASTORE_ENDPOINT=http://node01:2379,http://node02:2379,http://node03:2379
ExecStart=/usr/local/sbin/k3s server --no-deploy traefik --bind-address {{wg_ip}} --advertise-address {{wg_ip}}
Exec=/usr/local/sbin/k3s server --no-deploy traefik --bind-address {{wg_ip}} --advertise_address {{wg_ip}}

View File

@ -35,5 +35,3 @@
path: /etc/hosts
line: "{{item.value.wg_ip}} {{item.key}}"
loop: "{{hostvars|dict2items}}"
- name: fire handlers
meta: flush_handlers