+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+ This field is optional
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SnowBear/blueprints/inventory/network/templates/network/network_delete.html.j2 b/SnowBear/blueprints/inventory/network/templates/network/network_delete.html.j2
new file mode 100644
index 0000000..9be9fd8
--- /dev/null
+++ b/SnowBear/blueprints/inventory/network/templates/network/network_delete.html.j2
@@ -0,0 +1,65 @@
+
Network Management
+
+ Network delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SnowBear/blueprints/inventory/network/templates/network/network_modify.html.j2 b/SnowBear/blueprints/inventory/network/templates/network/network_modify.html.j2
new file mode 100644
index 0000000..e20f41a
--- /dev/null
+++ b/SnowBear/blueprints/inventory/network/templates/network/network_modify.html.j2
@@ -0,0 +1,42 @@
+
Network Management
+
+ Network modify
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SnowBear/blueprints/inventory/network/templates/network/networks.html.j2 b/SnowBear/blueprints/inventory/network/templates/network/networks.html.j2
new file mode 100644
index 0000000..679afd7
--- /dev/null
+++ b/SnowBear/blueprints/inventory/network/templates/network/networks.html.j2
@@ -0,0 +1,78 @@
+
+
+
Networks management
+
+ Manage networks
+
+
+
+
+
+
+
+
+{% for net in network_list %}
+
+
+
+
+
+
+
+{% endfor %}
+
+
+
diff --git a/SnowBear/functions/__pycache__/bbui.cpython-39.pyc b/SnowBear/functions/__pycache__/bbui.cpython-39.pyc
index 5348d6d..01feaa5 100644
Binary files a/SnowBear/functions/__pycache__/bbui.cpython-39.pyc and b/SnowBear/functions/__pycache__/bbui.cpython-39.pyc differ
diff --git a/SnowBear/functions/bbui.py b/SnowBear/functions/bbui.py
index cd59b02..cd68400 100644
--- a/SnowBear/functions/bbui.py
+++ b/SnowBear/functions/bbui.py
@@ -37,4 +37,44 @@ def load_page_navigation_data(page_navigation_data):
for service in page_navigation_data:
if service['sub_navigation']:
page_navigation_data[0]['sub_navigation_elements'] = load_yaml(service['path'].replace('.','/').replace('main','navigation.yml'))
- return page_navigation_data
\ No newline at end of file
+ return page_navigation_data
+
+def update_yaml(yamlFile,yamlPath,data):
+ """This function inserts yaml data into a file
+
+ Args:
+ yamlFile ([string]): path to the file to write to
+ yamlPath ([String]): list of the path to get to the attribute
+ data ([string]): data that you want to insert into the path in the file.
+
+ for example, if your file looks like this :
+ general_settings:
+ root_path:
+
+ then insertFile("file.yml",['general_settings','root_path'],test)
+ will result in your file looking like this:
+ general_settings:
+ root_path: test
+
+ """
+ if(len(yamlPath)==2):
+ stream=open(yamlFile,'r')
+ fileData=yaml.safe_load(stream)
+ fileData[yamlPath[0]][yamlPath[1]]=data
+ with open(yamlFile, 'w', encoding='utf8') as outfile:
+ outfile.write(yaml.dump(fileData,default_flow_style=False))
+ elif(len(yamlPath)==3):
+ stream=open(yamlFile,'r')
+ fileData=yaml.safe_load(stream)
+ fileData[yamlPath[0]][yamlPath[1]][yamlPath[2]]=data
+ with open(yamlFile, 'w', encoding='utf8') as outfile:
+ outfile.write(yaml.dump(fileData,default_flow_style=False))
+ elif(len(yamlPath)==4):
+ stream=open(yamlFile,'r')
+ fileData=yaml.safe_load(stream)
+ fileData[yamlPath[0]][yamlPath[1]][yamlPath[2]][yamlPath[3]]=data
+ with open(yamlFile, 'w', encoding='utf8') as outfile:
+ outfile.write(yaml.dump(fileData,default_flow_style=False))
+ else:
+ print("Path superior to 4 is not supported")
+
\ No newline at end of file
diff --git a/SnowBear/general_settings.yml b/SnowBear/general_settings.yml
new file mode 100644
index 0000000..6959fe8
--- /dev/null
+++ b/SnowBear/general_settings.yml
@@ -0,0 +1,2 @@
+general_settings:
+ root_path: simple_cluster/inventory
diff --git a/SnowBear/simple_cluster/README b/SnowBear/simple_cluster/README
new file mode 100644
index 0000000..06e71c4
--- /dev/null
+++ b/SnowBear/simple_cluster/README
@@ -0,0 +1,11 @@
+This examples is composed of:
+
+* 1 management node. Network: 10.10.0.1 as main interface, 10.10.100.1 as bmc
+* 1 login node. Network: 10.10.2.1, 10.10.102.1
+* 4 computes nodes. Network: 10.10.3.[1-4], 10.10.103.[1-4]
+
+Each node is also connected to an interconnect, on 10.20.0.0 subnet.
+
+All of them are link with a single ethernet management network, and with an interconnect.
+
+Management node exports /opt/software and /home to the others nodes through NFS.
diff --git a/SnowBear/simple_cluster/inventory/cluster/groups/rack1 b/SnowBear/simple_cluster/inventory/cluster/groups/rack1
new file mode 100644
index 0000000..2ac2a9f
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/cluster/groups/rack1
@@ -0,0 +1,7 @@
+[rack_1]
+management1
+c[001:004]
+login1
+
+[rack_1:vars]
+rack_number=1
diff --git a/SnowBear/simple_cluster/inventory/cluster/nodes/computes.yml b/SnowBear/simple_cluster/inventory/cluster/nodes/computes.yml
new file mode 100644
index 0000000..6330ad5
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/cluster/nodes/computes.yml
@@ -0,0 +1,60 @@
+mg_computes:
+ children:
+ equipment_typeC:
+ hosts:
+ c001:
+ bmc:
+ name: bc001
+ ip4: 10.10.103.1
+ mac: 08:00:27:dc:44:91
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s9
+ ip4: 10.10.3.1
+ mac: 08:00:27:0d:44:90
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.3.1
+ network: interconnect-1
+ c002:
+ bmc:
+ name: bc002
+ ip4: 10.10.103.2
+ mac: 08:00:27:dc:54:91
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s9
+ ip4: 10.10.3.2
+ mac: 08:00:27:0d:54:90
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.3.2
+ network: interconnect-1
+ c003:
+ bmc:
+ name: bc003
+ ip4: 10.10.103.3
+ mac: 08:00:27:dc:64:91
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s9
+ ip4: 10.10.3.3
+ mac: 08:00:27:0d:64:90
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.3.3
+ network: interconnect-1
+ c004:
+ bmc:
+ name: bc004
+ ip4: 10.10.103.4
+ mac: 08:00:27:dc:74:91
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s9
+ ip4: 10.10.3.4
+ mac: 08:00:27:0d:74:91
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.3.4
+ network: interconnect-1
diff --git a/SnowBear/simple_cluster/inventory/cluster/nodes/logins.yml b/SnowBear/simple_cluster/inventory/cluster/nodes/logins.yml
new file mode 100644
index 0000000..23ffd5b
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/cluster/nodes/logins.yml
@@ -0,0 +1,18 @@
+mg_logins:
+ children:
+ equipment_typeL:
+ hosts:
+ login1:
+ bmc:
+ name: blogin1
+ ip4: 10.10.102.1
+ mac: 08:00:27:dc:f8:a7
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s3
+ ip4: 10.10.2.1
+ mac: 08:00:27:dc:f8:a5
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.2.1
+ network: interconnect-1
diff --git a/SnowBear/simple_cluster/inventory/cluster/nodes/managements.yml b/SnowBear/simple_cluster/inventory/cluster/nodes/managements.yml
new file mode 100644
index 0000000..ec4f18e
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/cluster/nodes/managements.yml
@@ -0,0 +1,18 @@
+mg_managements:
+ children:
+ equipment_typeM:
+ hosts:
+ management1:
+ bmc:
+ name: bmanagement1
+ ip4: 10.10.100.1
+ mac: 08:00:27:dc:f8:f6
+ network: ice1-1
+ network_interfaces:
+ - interface: enp0s3
+ ip4: 10.10.0.1
+ mac: 08:00:27:dc:f8:f5
+ network: ice1-1
+ - interface: ib0
+ ip4: 10.20.0.1
+ network: interconnect-1
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/authentication.yml b/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/authentication.yml
new file mode 100644
index 0000000..6d5c625
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/authentication.yml
@@ -0,0 +1,7 @@
+---
+# Root password to be used on deployed hosts
+authentication_root_password_sha512: $6$M3crarMVoUV3rALd$ZTre2CIyss7zOb4lkLoG23As9OAkYPw2BM88Y1F43n8CCyV5XWwAYEwBOrS8bcCBIMjIPdJG.ndOfzWyAVR4j0 # This password is 'root', change it!
+
+# SSH public keys to be added as authorized keys on deployed/managed hosts
+authentication_ssh_keys:
+ - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDodjKUXHm1K7HkQ8rgyXDfOAW9wvWHz24+YpkNGO0wI/jS0E44F4pdfNSqUWfLfBwwyiJ/+iLQAcJZjrQ1CnECNtImpHNRuMVH6shXX99oYRDOfJ8/MV89zrAe/KDUR677/j1dHYIS1fGzOzsxey00n+2c4LqxiFvwEIOGkB6W96aIQTx+V7eTxMegYrNttlh9eSR8yr8n4+0qk29wVVvtMysEUIt1z12dtqOr7lBuXhOy9EIUz+EZpPyXFrJiNBaKFpZBJXjzzRwR0uplyH5qf3tb3vgIxgHDPKiYRIOf3Caa9XAgmE1BU+R36wvLoS2z58ELQekJeO5z7TpsxXeB root@localhost.localdomain
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/equipment_profile.yml
new file mode 100644
index 0000000..4a520e8
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/equipment_all/equipment_profile.yml
@@ -0,0 +1,51 @@
+---
+
+# iPXE network driver
+# default should be good for most of NIC, but some need SNP. Refer to http://ipxe.org/appnote/buildtargets for more information.
+ep_ipxe_driver: default # default or snp or snponly
+ep_ipxe_platform: pcbios # can be pcbios (for legacy/bios) or efi
+ep_ipxe_embed: standard # can be standard or dhcpretry
+
+# When installing in EFI, grub2 break the boot order and set next boot to disk (seriously, why??!)
+# In most case, you prefer system to continue to boot on PXE, and so the stack can restore first boot device after grub2 installation
+ep_preserve_efi_first_boot_device: true # true or false
+
+ep_console:
+ep_kernel_parameters:
+
+ep_access_control: enforcing # Selinux, AppArmor, etc. Selinux: enforcing, permissive, disabled
+ep_firewall: true # Enable or disable native firewall
+
+ep_partitioning: | # Please provide native distribution partitioning. This example is for Centos/RedHat systems.
+ clearpart --all --initlabel
+ autopart --type=plain --fstype=ext4 --nohome
+
+ep_autoinstall_pre_script: # Add optional pre script in auto installer file (kickstart, preseed, autoyast)
+ep_autoinstall_post_script: # Add optional post script in auto installer file (kickstart, preseed, autoyast)
+
+ep_operating_system:
+ distribution: centos # centos, redhat, debian, ubuntu, opensuse, etc.
+ distribution_major_version: 8
+ # Optional: define a minor distribution version to force (repositories/PXE)
+ # distribution_version: 8.0
+ # Optional: add an environment in the repositories path (eg. production, staging) (repositories/PXE)
+ # repositories_environment: production
+
+ep_equipment_type: none # If server, a pxe profile will be generated
+
+ep_configuration:
+ keyboard_layout: us # us, fr, etc.
+ system_language: en_US.UTF-8 # You should not update this if you want to google issues...
+
+ep_hardware:
+ cpu:
+ architecture: x86_64 # Can be x86_64 or arm64
+ cores: 1 # Mainly for slurm, but optional. You can define here detailed information on the CPUs.
+ cores_per_socket: 1
+ sockets: 1
+ threads_per_core: 1
+ gpu:
+
+ep_equipment_authentication: # login/password for BMC, storage bay controller, switch, etc.
+ user: user
+ password: password
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/external.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/external.yml
new file mode 100644
index 0000000..864605f
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/external.yml
@@ -0,0 +1,19 @@
+external_time:
+ time_server:
+ pool: # List of possible time pools
+ - pool.ntp.org
+ server: # List of possible time servers
+ - 0.pool.ntp.org
+ - 1.pool.ntp.org
+ time_client:
+ pool:
+ server:
+
+external_dns:
+ dns_server: # set as forwarders in named.conf
+ dns_client: # set directly on client side in resolv.conf
+ - 208.67.220.220
+
+# Hosts defined here will be automatically added into /etc/hosts
+external_hosts:
+ sphenisc.com: 213.186.33.3
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/general.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/general.yml
new file mode 100644
index 0000000..a2913b2
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/general.yml
@@ -0,0 +1,17 @@
+### General settings file
+
+cluster_name: algoric
+
+# Localisation
+time_zone: Europe/Brussels
+
+# Internal mechanisms
+icebergs_system: false # Activate or deactivate icebergs topology system. Experimental.
+
+# Services handling
+enable_services: true # Enable or disable services on startup (set to false when using high availability)
+start_services: true # Handle start/restart of the services (set to false when using high availability)
+
+# /etc/hosts
+hosts_file:
+ range: all # can be all (all hosts) or iceberg (iceberg only)
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/internal_variables.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/internal_variables.yml
new file mode 100644
index 0000000..667f929
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/internal_variables.yml
@@ -0,0 +1,7 @@
+### Internal variables, used to define naming convention
+
+iceberg_naming: iceberg
+equipment_naming: equipment
+management_networks_naming: ice
+master_groups_naming: mg
+managements_group_name: mg_managements
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/network.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/network.yml
new file mode 100644
index 0000000..9bd5155
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/network.yml
@@ -0,0 +1,9 @@
+domain_name: tumulus.local
+networks:
+ interconnect-1:
+ broadcast: 10.20.255.255
+ is_in_dhcp: false
+ is_in_dns: true
+ netmask: 255.255.0.0
+ prefix: 16
+ subnet: 10.20.0.0
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/nfs.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/nfs.yml
new file mode 100644
index 0000000..d46734e
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/nfs.yml
@@ -0,0 +1,26 @@
+nfs_settings:
+ selinux:
+ use_nfs_home_dirs: true # Will automatically set this boolean to true if /home is mounted on client side
+
+nfs:
+ softwares:
+ mount: /opt/software # Which path clients should mount this NFS
+ export: /opt/software # What path server should export
+ server: management1 # The server that export this storage space
+ clients_groups: # Can be an equipment group, or a main group (mg), or any other ansible group
+ - mg_computes
+ - mg_logins
+ take_over_network: ice1-1 # Network used to share this storage space
+ export_arguments: ro,no_root_squash,async # Arguments for the server (export)
+ mount_arguments: ro,intr,nfsvers=4.2,bg # Arguments for the client (mount)
+
+ home:
+ mount: /home
+ export: /home
+ server: management1
+ clients_groups:
+ - mg_computes
+ - mg_logins
+ take_over_network: ice1-1
+ export_arguments: rw,no_root_squash,sync
+ mount_arguments: rw,intr,rsize=32768,wsize=32768,nfsvers=4.2,bg
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/repositories.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/repositories.yml
new file mode 100644
index 0000000..8d32640
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/repositories.yml
@@ -0,0 +1,3 @@
+repositories:
+ - bluebanquise
+ - os
diff --git a/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/security.yml b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/security.yml
new file mode 100644
index 0000000..bc21e8b
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/all/general_settings/security.yml
@@ -0,0 +1,4 @@
+---
+security:
+ ssh:
+ hostkey_checking: true # enable or disable hostkey checking
diff --git a/SnowBear/simple_cluster/inventory/group_vars/equipment_typeC/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeC/equipment_profile.yml
new file mode 100644
index 0000000..9b9215f
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeC/equipment_profile.yml
@@ -0,0 +1,21 @@
+---
+
+ep_console: console=tty0 console=ttyS1,115200n8
+ep_kernel_parameters: nomodeset
+
+ep_access_control: disabled
+ep_firewall: false
+
+ep_equipment_type: server
+
+ep_hardware:
+ cpu:
+ architecture: x86_64
+ cores: 24
+ cores_per_socket: 12
+ sockets: 2
+ threads_per_core: 1
+
+ep_equipment_authentication:
+ user: ADMIN
+ password: ADMIN
diff --git a/SnowBear/simple_cluster/inventory/group_vars/equipment_typeG/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeG/equipment_profile.yml
new file mode 100644
index 0000000..204d05c
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeG/equipment_profile.yml
@@ -0,0 +1,23 @@
+---
+
+ep_console: console=tty0 console=ttyS1,115200n8
+ep_kernel_parameters: nomodeset
+
+ep_access_control: disabled
+ep_firewall: false
+
+ep_equipment_type: server
+
+ep_hardware:
+ cpu:
+ architecture: x86_64
+ cores: 24
+ cores_per_socket: 12
+ sockets: 2
+ threads_per_core: 1
+ gpu:
+ - Hercules 3D Prophet 4000 XT
+
+ep_equipment_authentication:
+ user: ADMIN
+ password: ADMIN
diff --git a/SnowBear/simple_cluster/inventory/group_vars/equipment_typeL/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeL/equipment_profile.yml
new file mode 100644
index 0000000..a88194c
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeL/equipment_profile.yml
@@ -0,0 +1,12 @@
+---
+
+ep_console: console=tty0 console=ttyS1,115200n8
+
+ep_access_control: enforcing
+ep_firewall: true
+
+ep_equipment_type: server
+
+ep_equipment_authentication:
+ user: ADMIN
+ password: ADMIN
diff --git a/SnowBear/simple_cluster/inventory/group_vars/equipment_typeM/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeM/equipment_profile.yml
new file mode 100644
index 0000000..c968c8b
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeM/equipment_profile.yml
@@ -0,0 +1,27 @@
+---
+
+ep_console: console=tty0 console=ttyS1,115200n8
+
+ep_access_control: enforcing
+ep_firewall: true
+
+ep_partitioning: |
+ clearpart --all --initlabel
+ part /boot --fstype=ext4 --size=1024
+ part / --fstype=ext4 --size=60000
+ part /home --fstype=ext4 --size=4096 --grow
+
+ep_equipment_type: server
+
+ep_hardware:
+ cpu:
+ architecture: x86_64
+ cores: 8
+ cores_per_socket: 4
+ sockets: 1
+ threads_per_core: 2
+ gpu:
+
+ep_equipment_authentication:
+ user: ADMIN
+ password: ADMIN
diff --git a/SnowBear/simple_cluster/inventory/group_vars/equipment_typeS/equipment_profile.yml b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeS/equipment_profile.yml
new file mode 100644
index 0000000..29062fa
--- /dev/null
+++ b/SnowBear/simple_cluster/inventory/group_vars/equipment_typeS/equipment_profile.yml
@@ -0,0 +1,13 @@
+---
+
+ep_partitioning: |
+ clearpart --all --initlabel
+ part /boot --fstype=ext4 --size=1024
+ part / --fstype=ext4 --size=60000
+ part /home --fstype=ext4 --size=4096 --grow
+
+ep_equipment_type: server
+
+ep_equipment_authentication:
+ user: ADMIN
+ password: ADMIN
diff --git a/SnowBear/simple_cluster/playbooks/computes.yml b/SnowBear/simple_cluster/playbooks/computes.yml
new file mode 100644
index 0000000..11dfa84
--- /dev/null
+++ b/SnowBear/simple_cluster/playbooks/computes.yml
@@ -0,0 +1,23 @@
+---
+# use '--limit c001' to restrict playbook to
+# c001 if mg_computes contains multiple compute nodes
+- name: computes
+ hosts: "mg_computes" # Will deploy on all mg_computes group nodes if no --limit
+ roles:
+
+ - role: set_hostname
+ tags: set_hostname
+ - role: repositories_client
+ tags: repositories_client
+ - role: nic_nmcli
+ tags: nic_nmcli
+ - role: hosts_file
+ tags: hosts_file
+ - role: dns_client
+ tags: dns_client
+ - role: time
+ tags: time
+ vars:
+ time_profile: client
+ - role: nfs_client
+ tags: nfs_client
diff --git a/SnowBear/simple_cluster/playbooks/logins.yml b/SnowBear/simple_cluster/playbooks/logins.yml
new file mode 100644
index 0000000..e61b503
--- /dev/null
+++ b/SnowBear/simple_cluster/playbooks/logins.yml
@@ -0,0 +1,23 @@
+---
+# use '--limit login1' to restrict playbook to
+# login1 if mg_logins contains multiple login nodes
+- name: logins playbook
+ hosts: "mg_logins"
+ roles:
+
+ - role: set_hostname
+ tags: set_hostname
+ - role: repositories_client
+ tags: repositories_client
+ - role: nic_nmcli
+ tags: nic_nmcli
+ - role: hosts_file
+ tags: hosts_file
+ - role: dns_client
+ tags: dns_client
+ - role: time
+ tags: time
+ vars:
+ time_profile: client
+ - role: nfs_client
+ tags: nfs_client
diff --git a/SnowBear/simple_cluster/playbooks/managements.yml b/SnowBear/simple_cluster/playbooks/managements.yml
new file mode 100644
index 0000000..4fc4953
--- /dev/null
+++ b/SnowBear/simple_cluster/playbooks/managements.yml
@@ -0,0 +1,35 @@
+---
+# use '--limit management1' to restrict playbook to
+# management1 if mg_managements contains multiple management nodes
+- name: managements playbook
+ hosts: "mg_managements"
+ roles:
+
+ - role: set_hostname
+ tags: set_hostname
+ - role: nic_nmcli
+ tags: nic_nmcli
+ - role: repositories_server
+ tags: repositories_server
+ - role: repositories_client
+ tags: repositories_client
+ - role: bluebanquise
+ tags: bluebanquise
+ - role: hosts_file
+ tags: hosts_file
+ - role: ssh_client
+ tags: ssh_client
+ - role: dhcp_server
+ tags: dhcp_server
+ - role: dns_server
+ tags: dns_server
+ - role: dns_client
+ tags: dns_client
+ - role: time
+ tags: time
+ vars:
+ time_profile: server
+ - role: pxe_stack
+ tags: pxe_stack
+ - role: nfs_server
+ tags: nfs_server
diff --git a/SnowBear/snowbear.py b/SnowBear/snowbear.py
index 2f62ed8..3fedf90 100644
--- a/SnowBear/snowbear.py
+++ b/SnowBear/snowbear.py
@@ -22,7 +22,8 @@
import yaml
import json
import importlib
-from functions.bbui import load_yaml,dump_yaml,load_page_navigation_data
+from functions.bbui import load_yaml,dump_yaml,load_page_navigation_data,update_yaml
+
app = Flask(__name__)
@@ -47,19 +48,22 @@
app.register_blueprint(getattr(module, navigation['name']))
print('')
+
@app.route("/", methods=["GET","POST"])
def index():
if request.method== "POST":
full_path=request.form.get("full_path")
+ #check if the path exists
if (path.exists(str(full_path))):
+ update_yaml("general_settings.yml",['general_settings','root_path'],str(full_path))
return render_template("page.html.j2", page_content_path="home/index.html.j2", page_title="Home", page_navigation_data=page_navigation_data, path_check="Given path exists and will be used")
- #check if the path exists
print("checked"+full_path)
return render_template("page.html.j2", page_content_path="home/index.html.j2", page_title="Home", page_navigation_data=page_navigation_data, path_check="Given path does not exist")
return render_template("page.html.j2", page_content_path="home/index.html.j2", page_title="Home", page_navigation_data=page_navigation_data, path_check="Please enter a path")
if __name__ == '__main__':
-
+ print("loading configuration with the following parameters:")
+ print(load_yaml("general_settings.yml"))
print('''
_.--""""--.._
_."" ." `-._
diff --git a/SnowBear/static/js/modal.js b/SnowBear/static/js/modal.js
new file mode 100644
index 0000000..0d6dd1c
--- /dev/null
+++ b/SnowBear/static/js/modal.js
@@ -0,0 +1,87 @@
+document.addEventListener('DOMContentLoaded', () => {
+
+ // Get all dropdowns on the page that aren't hoverable.
+ const dropdowns = document.querySelectorAll('.dropdown:not(.is-hoverable)');
+
+ if (dropdowns.length > 0) {
+ // For each dropdown, add event handler to open on click.
+ dropdowns.forEach(function(el) {
+ el.addEventListener('click', function(e) {
+ closeDropdowns();
+ e.stopPropagation();
+ el.classList.toggle('is-active');
+ });
+ });
+
+ // If user clicks outside dropdown, close it.
+ document.addEventListener('click', function(e) {
+ closeDropdowns();
+ });
+ }
+
+ /*
+ * Close dropdowns by removing `is-active` class.
+ */
+ function closeDropdowns() {
+ dropdowns.forEach(function(el) {
+ el.classList.remove('is-active');
+ });
+ }
+
+ // Close dropdowns if ESC pressed
+ document.addEventListener('keydown', function (event) {
+ let e = event || window.event;
+ if (e.key === 'Esc' || e.key === 'Escape') {
+ closeDropdowns();
+ }
+ });
+
+
+ // Functions to open and close a modal
+ function openModal($el) {
+ $el.classList.add('is-active');
+ }
+
+ function closeModal($el) {
+ $el.classList.remove('is-active');
+ }
+
+ function closeAllModals() {
+ (document.querySelectorAll('.modal') || []).forEach(($modal) => {
+ closeModal($modal);
+ });
+ }
+
+ // Add a click event on buttons to open a specific modal
+ (document.querySelectorAll('.js-modal-trigger') || []).forEach(($trigger) => {
+ const modal = $trigger.dataset.target;
+ const $target = document.getElementById(modal);
+ console.log($target);
+
+ $trigger.addEventListener('click', () => {
+ openModal($target);
+ });
+ });
+
+ // Add a click event on various child elements to close the parent modal
+ (document.querySelectorAll('.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button') || []).forEach(($close) => {
+ const $target = $close.closest('.modal');
+
+ $close.addEventListener('click', () => {
+ closeModal($target);
+ });
+ });
+
+ // Add a keyboard event to close all modals
+ document.addEventListener('keydown', (event) => {
+ const e = event || window.event;
+
+ if (e.keyCode === 27) { // Escape key
+ closeAllModals();
+ }
+ });
+ });
+
+
+
+