Merge branch 'master' into librarian
Conflicts: examples/openstack/openstack.py
This commit is contained in:
9
resources/apt_repo/actions/remove.yaml
Normal file
9
resources/apt_repo/actions/remove.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: rm -f {{item}}
|
||||
with_items:
|
||||
- /etc/apt/sources.list.d/{{name}}.list
|
||||
- /etc/apt/preferences.d/{{name}}.pref
|
||||
- shell: apt-get update
|
||||
when: {{validate_integrity}}
|
||||
11
resources/apt_repo/actions/run.yaml
Normal file
11
resources/apt_repo/actions/run.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- template:
|
||||
src: {{templates_dir}}/source
|
||||
dest: /etc/apt/sources.list.d/{{name}}.list
|
||||
- template:
|
||||
src: {{templates_dir}}/preferences
|
||||
dest: /etc/apt/preferences.d/{{name}}.pref
|
||||
- shell: apt-get update
|
||||
when: {{validate_integrity}}
|
||||
25
resources/apt_repo/meta.yaml
Normal file
25
resources/apt_repo/meta.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
id: apt_repo
|
||||
handler: ansible
|
||||
version: 1.0.0
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
repo:
|
||||
schema: str!
|
||||
value:
|
||||
name:
|
||||
schema: str!
|
||||
value:
|
||||
package:
|
||||
schema: str
|
||||
value: '*'
|
||||
pin:
|
||||
schema: str
|
||||
value:
|
||||
pin_priority:
|
||||
schema: int
|
||||
value:
|
||||
validate_integrity:
|
||||
schema: bool
|
||||
value: true
|
||||
3
resources/apt_repo/templates/preferences
Normal file
3
resources/apt_repo/templates/preferences
Normal file
@@ -0,0 +1,3 @@
|
||||
Package: {{package}}
|
||||
Pin: {{pin}}
|
||||
Pin-Priority: {{pin_priority}}
|
||||
1
resources/apt_repo/templates/source
Normal file
1
resources/apt_repo/templates/source
Normal file
@@ -0,0 +1 @@
|
||||
{{repo}}
|
||||
7
resources/managed_apt/actions/run.yaml
Normal file
7
resources/managed_apt/actions/run.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: echo 'Managed by solar' > /etc/apt/sources.list
|
||||
when: {{ensure_other_removed}}
|
||||
- shell: apt-get update
|
||||
when: {{ensure_other_removed}}
|
||||
17
resources/managed_apt/meta.yaml
Normal file
17
resources/managed_apt/meta.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
# This resource will clean
|
||||
id: apt_repo_manager
|
||||
handler: ansible
|
||||
version: 1.0.0
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
repos:
|
||||
schema: [str!]
|
||||
value:
|
||||
names:
|
||||
schema: [str!]
|
||||
value:
|
||||
ensure_other_removed:
|
||||
schema: bool
|
||||
value: true
|
||||
9
resources/node_network_puppet/README.md
Normal file
9
resources/node_network_puppet/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Node network resource for puppet handler
|
||||
|
||||
Setup and configure L23 networking for a node.
|
||||
Leverages the powerful network_scheme structures to
|
||||
create all required networking entities like interfaces,
|
||||
bridges, bonds - both linux and ovs based.
|
||||
Defaults are given for Debian OS family.
|
||||
|
||||
source https://github.com/xenolog/l23network
|
||||
3
resources/node_network_puppet/actions/remove.pp
Normal file
3
resources/node_network_puppet/actions/remove.pp
Normal file
@@ -0,0 +1,3 @@
|
||||
class {'l23network':
|
||||
ensure_package => 'absent',
|
||||
}
|
||||
41
resources/node_network_puppet/actions/run.pp
Normal file
41
resources/node_network_puppet/actions/run.pp
Normal file
@@ -0,0 +1,41 @@
|
||||
$resource = hiera($::resource_name)
|
||||
|
||||
$ensure_package = $resource['input']['ensure_package']['value']
|
||||
$use_lnx = $resource['input']['use_lnx']['value']
|
||||
$use_ovs = $resource['input']['use_ovs']['value']
|
||||
$install_ovs = $resource['input']['install_ovs']['value']
|
||||
$install_brtool = $resource['input']['install_brtool']['value']
|
||||
$install_ethtool = $resource['input']['install_ethtool']['value']
|
||||
$install_bondtool = $resource['input']['install_bondtool']['value']
|
||||
$install_vlantool = $resource['input']['install_vlantool']['value']
|
||||
$ovs_modname = $resource['input']['ovs_modname']['value']
|
||||
$ovs_datapath_package_name = $resource['input']['ovs_datapath_package_name']['value']
|
||||
$ovs_common_package_name = $resource['input']['ovs_common_package_name']['value']
|
||||
$network_scheme = $resource['input']['network_scheme']['value']
|
||||
|
||||
class {'l23network':
|
||||
ensure_package => $ensure_package,
|
||||
use_lnx => $use_lnx,
|
||||
use_ovs => $use_ovs,
|
||||
install_ovs => $install_ovs,
|
||||
install_brtool => $install_brtool,
|
||||
install_ethtool => $install_ethtool,
|
||||
install_bondtool => $install_bondtool,
|
||||
install_vlantool => $install_vlantool,
|
||||
ovs_modname => $ovs_modname,
|
||||
ovs_datapath_package_name => $ovs_datapath_package_name,
|
||||
ovs_common_package_name => $ovs_common_package_name,
|
||||
}
|
||||
|
||||
prepare_network_config($network_scheme)
|
||||
$sdn = generate_network_config()
|
||||
notify { $sdn: require => Class['l23network'], }
|
||||
|
||||
# We need to wait at least 30 seconds for the bridges and other interfaces to
|
||||
# come up after being created. This should allow for all interfaces to be up
|
||||
# and ready for traffic before proceeding with further deploy steps. LP#1458954
|
||||
exec { 'wait-for-interfaces':
|
||||
path => '/usr/bin:/bin',
|
||||
command => 'sleep 32',
|
||||
require => Notify[$sdn]
|
||||
}
|
||||
60
resources/node_network_puppet/meta.yaml
Normal file
60
resources/node_network_puppet/meta.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
id: node_network_puppet
|
||||
handler: puppet
|
||||
puppet_module: l23network
|
||||
version: 1.0.0
|
||||
input:
|
||||
package_ensure:
|
||||
schema: str
|
||||
value: 'present'
|
||||
ensure_package:
|
||||
schema: str
|
||||
value: 'present'
|
||||
use_lnx:
|
||||
schema: bool
|
||||
value: true
|
||||
use_ovs:
|
||||
schema: bool
|
||||
value: false
|
||||
install_ovs:
|
||||
schema: bool
|
||||
value: true
|
||||
install_brtool:
|
||||
schema: bool
|
||||
value: true
|
||||
install_ethtool:
|
||||
schema: bool
|
||||
value: true
|
||||
install_bondtool:
|
||||
schema: bool
|
||||
value: true
|
||||
install_vlantool:
|
||||
schema: bool
|
||||
value: true
|
||||
ovs_modname:
|
||||
schema: str
|
||||
value: 'openvswitch'
|
||||
ovs_datapath_package_name:
|
||||
schema: str
|
||||
value: 'openvswitch-datapath-dkms'
|
||||
ovs_common_package_name:
|
||||
schema: str
|
||||
value: 'openvswitch-switch'
|
||||
network_scheme:
|
||||
schema: {
|
||||
version: str!,
|
||||
provider: str!,
|
||||
interfaces: {},
|
||||
transformations: [{}],
|
||||
endpoints: {},
|
||||
roles: {},
|
||||
}
|
||||
|
||||
git:
|
||||
schema: {repository: str!, branch: str!}
|
||||
value: {repository: 'https://github.com/xenolog/l23network', branch: '50098cfa1f0f8e8d58e6a6b77a22f1380aa5c426'}
|
||||
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
|
||||
tags: [resources/node_network]
|
||||
11
resources/node_network_puppet/test.py
Normal file
11
resources/node_network_puppet/test.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import requests
|
||||
|
||||
from solar.core.log import log
|
||||
|
||||
|
||||
def test(resource):
|
||||
log.debug('Testing node_network_puppet')
|
||||
# requests.get(
|
||||
# 'http://%s:%s' % (resource.args['ip'].value, resource.args['port'].value)
|
||||
# TODO(bogdando) figure out how to test this
|
||||
# )
|
||||
9
resources/transport_torrent/actions/run.yaml
Normal file
9
resources/transport_torrent/actions/run.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
- hosts: [{{ host }}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: python-libtorrent
|
||||
state: present
|
||||
- copy:
|
||||
src: {{scripts_dir}}/solar_torrent.py
|
||||
dest: /var/tmp/solar_torrent.py
|
||||
18
resources/transport_torrent/meta.yaml
Normal file
18
resources/transport_torrent/meta.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
id: transport_torrent
|
||||
handler: ansible
|
||||
input:
|
||||
trackers:
|
||||
schema: [str!]
|
||||
value: []
|
||||
name:
|
||||
schema: str!
|
||||
value: torrent
|
||||
location_id:
|
||||
schema: str
|
||||
value:
|
||||
reverse: True
|
||||
is_own: False
|
||||
transports_id:
|
||||
schema: str
|
||||
value:
|
||||
is_emit: False
|
||||
1
resources/transport_torrent/scripts/solar_torrent.py
Symbolic link
1
resources/transport_torrent/scripts/solar_torrent.py
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../solar/solar/core/transports/helpers/solar_torrent.py
|
||||
@@ -1,7 +1,7 @@
|
||||
id: transports
|
||||
input:
|
||||
transports:
|
||||
schema: [{user: str, password: str, port: int!, key: str, name: str!}]
|
||||
schema: [{user: str, password: str, port: int!, key: str, name: str!, trackers: [str]}]
|
||||
value: []
|
||||
transports_id:
|
||||
schema: str!
|
||||
|
||||
Reference in New Issue
Block a user