Add container_networks, ssh_key and vxlan_mesh resources
This commit is contained in:
parent
88f2ba4725
commit
418066b827
22
resources/container_networks/actions/run.yml
Normal file
22
resources/container_networks/actions/run.yml
Normal file
@ -0,0 +1,22 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
gather_facts: false
|
||||
# this is default variables, they will be overwritten by resource one
|
||||
vars:
|
||||
networks:
|
||||
mgmt:
|
||||
address: 172.18.10.6
|
||||
bridge: br-test0
|
||||
bridge_address: 172.18.10.252/24
|
||||
interface: eth1
|
||||
netmask: 255.255.255.0
|
||||
type: veth
|
||||
tasks:
|
||||
- shell: ip l add {{item.value.bridge}} type bridge
|
||||
with_dict: networks
|
||||
ignore_errors: true
|
||||
- shell: ip l set {{item.value.bridge}} up
|
||||
with_dict: networks
|
||||
- shell: ip a add dev {{item.value.bridge}} {{item.value.bridge_address}}
|
||||
with_dict: networks
|
||||
ignore_errors: true
|
17
resources/container_networks/meta.yaml
Normal file
17
resources/container_networks/meta.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
id: container_networks
|
||||
handler: ansible_playbook
|
||||
version: 1.0.0
|
||||
actions:
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
networks:
|
||||
schema: {}
|
||||
value:
|
12
resources/ssh_key/actions/run.yml
Normal file
12
resources/ssh_key/actions/run.yml
Normal file
@ -0,0 +1,12 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
gather_facts: false
|
||||
# this is default variables, they will be overwritten by resource one
|
||||
vars:
|
||||
path: /vagrant/.ssh/id_rsa
|
||||
passphrase: containers
|
||||
tasks:
|
||||
- stat: path={{path}}
|
||||
register: key
|
||||
- shell: ssh-keygen -t rsa -f {{path}} -N {{passphrase}}
|
||||
when: key.stat.exists == False
|
23
resources/ssh_key/meta.yaml
Normal file
23
resources/ssh_key/meta.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
id: ssh_key
|
||||
handler: ansible_playbook
|
||||
version: 1.0.0
|
||||
actions:
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
path:
|
||||
schema: str!
|
||||
value:
|
||||
pub_path:
|
||||
schema: str!
|
||||
value:
|
||||
passphrase:
|
||||
schema: str
|
||||
value: default_passphrase
|
16
resources/vxlan_mesh/actions/run.yml
Normal file
16
resources/vxlan_mesh/actions/run.yml
Normal file
@ -0,0 +1,16 @@
|
||||
- hosts: '*'
|
||||
sudo: yes
|
||||
vars:
|
||||
id: 42
|
||||
group: 239.1.10.2
|
||||
parent: eth1
|
||||
master: br-test0
|
||||
tasks:
|
||||
- name: add vxlan mesh
|
||||
shell: ip l add vxlan{{id}} type vxlan id {{id}}
|
||||
group {{group}} dev {{parent}}
|
||||
ignore_errors: true
|
||||
- name: set vxlan master
|
||||
shell: ip l set vxlan{{id}} master {{master}}
|
||||
- name: set vxlan tunnel up
|
||||
shell: ip l set vxlan{{id}} up
|
23
resources/vxlan_mesh/meta.yaml
Normal file
23
resources/vxlan_mesh/meta.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
id: vxlan_mesh
|
||||
handler: ansible_playbook
|
||||
version: 1.0.0
|
||||
actions:
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
parent:
|
||||
schema: str!
|
||||
value:
|
||||
master:
|
||||
schema: str!
|
||||
value:
|
||||
id:
|
||||
schema: int!
|
||||
value:
|
Loading…
Reference in New Issue
Block a user