forked from LibreSchool/server-config
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
8cc383d53b | |||
a57ba6a533 | |||
dec0f5a6cc | |||
b411d4d96c | |||
c8bba8f0a0 | |||
93a68f626d | |||
a84be475bc | |||
c0f62fe8a0 | |||
6f09f0d209 | |||
daf8badd85 | |||
dc57a5639b | |||
5342d1d2d3 | |||
31f644e640 | |||
44f2797270 |
142
Vagrantfile
vendored
142
Vagrantfile
vendored
@ -1,141 +1,29 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# All Vagrant configuration is done here. The most common configuration
|
||||
# options are documented and commented below. For a complete reference,
|
||||
# please see the online documentation at vagrantup.com.
|
||||
|
||||
# Every Vagrant virtual environment requires a box to build off of.
|
||||
|
||||
# Defining a base vm name:
|
||||
myname = "NethServer"
|
||||
myname = "NethServer7-dev"
|
||||
|
||||
config.vm.box = "syntaxerrormmm/nethserver-6.9"
|
||||
config.vm.box_url = "https://vagrant.libreschool.org/nethserver-6.9"
|
||||
config.vm.define myname do |nethserver|
|
||||
end
|
||||
config.vm.provider :virtualbox do |vb|
|
||||
vb.name = myname
|
||||
nethserver.vm.box = "syntaxerrormmm/nethserver-7"
|
||||
nethserver.vm.box_url = "https://vagrant.libreschool.org/nethserver-7"
|
||||
|
||||
nethserver.vm.provider :libvirt do |lv|
|
||||
lv.keymap = 'it'
|
||||
end
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
nethserver.vm.network :private_network,
|
||||
:ip => "172.16.253.1",
|
||||
:auto_config => false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
config.vm.network "private_network", ip: "172.16.254.1", auto_config: false
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network "public_network"
|
||||
|
||||
# If true, then any SSH connections made will enable agent forwarding.
|
||||
# Default value: false
|
||||
# config.ssh.forward_agent = true
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
# config.vm.provider "virtualbox" do |vb|
|
||||
# # Don't boot with headless mode
|
||||
# vb.gui = true
|
||||
#
|
||||
# # Use VBoxManage to customize the VM. For example to change memory:
|
||||
# #vb.customize ["modifyvm", :id, "--memory", "1024"]
|
||||
# end
|
||||
#
|
||||
# View the documentation for the provider you're using for more
|
||||
# information on available options.
|
||||
|
||||
# Enable provisioning with CFEngine. CFEngine Community packages are
|
||||
# automatically installed. For example, configure the host as a
|
||||
# policy server and optionally a policy file to run:
|
||||
#
|
||||
# config.vm.provision "cfengine" do |cf|
|
||||
# cf.am_policy_hub = true
|
||||
# # cf.run_file = "motd.cf"
|
||||
# end
|
||||
#
|
||||
# You can also configure and bootstrap a client to an existing
|
||||
# policy server:
|
||||
#
|
||||
# config.vm.provision "cfengine" do |cf|
|
||||
# cf.policy_server_address = "10.0.2.15"
|
||||
# end
|
||||
|
||||
# Enable provisioning with Puppet stand alone. Puppet manifests
|
||||
# are contained in a directory path relative to this Vagrantfile.
|
||||
# You will need to create the manifests directory and a manifest in
|
||||
# the file default.pp in the manifests_path directory.
|
||||
#
|
||||
# config.vm.provision "puppet" do |puppet|
|
||||
# puppet.manifests_path = "manifests"
|
||||
# puppet.manifest_file = "default.pp"
|
||||
# end
|
||||
|
||||
# Enable provisioning with chef solo, specifying a cookbooks path, roles
|
||||
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
||||
# some recipes and/or roles.
|
||||
#
|
||||
# config.vm.provision "chef_solo" do |chef|
|
||||
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
||||
# chef.roles_path = "../my-recipes/roles"
|
||||
# chef.data_bags_path = "../my-recipes/data_bags"
|
||||
# chef.add_recipe "mysql"
|
||||
# chef.add_role "web"
|
||||
#
|
||||
# # You may also specify custom JSON attributes:
|
||||
# chef.json = { mysql_password: "foo" }
|
||||
# end
|
||||
|
||||
# Enable provisioning with chef server, specifying the chef server URL,
|
||||
# and the path to the validation key (relative to this Vagrantfile).
|
||||
#
|
||||
# The Opscode Platform uses HTTPS. Substitute your organization for
|
||||
# ORGNAME in the URL and validation key.
|
||||
#
|
||||
# If you have your own Chef Server, use the appropriate URL, which may be
|
||||
# HTTP instead of HTTPS depending on your configuration. Also change the
|
||||
# validation key to validation.pem.
|
||||
#
|
||||
# config.vm.provision "chef_client" do |chef|
|
||||
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
||||
# chef.validation_key_path = "ORGNAME-validator.pem"
|
||||
# end
|
||||
#
|
||||
# If you're using the Opscode platform, your validator client is
|
||||
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
||||
#
|
||||
# If you have your own Chef Server, the default validation client name is
|
||||
# chef-validator, unless you changed the configuration.
|
||||
#
|
||||
# chef.validation_client_name = "ORGNAME-validator"
|
||||
config.vm.provision "ansible" do |ansible|
|
||||
# Using default dynamic inventory
|
||||
ansible.playbook = "provision.yml"
|
||||
ansible.groups = {
|
||||
"vagrant" => [ myname ]
|
||||
}
|
||||
ansible.compatibility_mode = "2.0"
|
||||
nethserver.vm.provision :ansible do |a|
|
||||
a.compatibility_mode = "2.0"
|
||||
a.playbook = "provision.yml"
|
||||
a.groups = { "vagrant" => [ myname ] }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -2,4 +2,7 @@
|
||||
host_key_checking=False
|
||||
inventory=hosts
|
||||
roles_path=roles
|
||||
|
||||
[ssh_connections]
|
||||
#ssh_args= -o ServerAliveInterval=30 -o ControlMaster=auto -o ControlPersist=60s
|
||||
pipelining=True
|
||||
|
12
domain.yml
12
domain.yml
@ -2,15 +2,17 @@
|
||||
# Configurazione dominio
|
||||
ntpserver: pdc.topolin.ia
|
||||
server: pdc
|
||||
serverip: 172.16.254.1
|
||||
serverip: 172.16.253.1
|
||||
nsdc_ipaddress: 172.16.253.2
|
||||
servernetmask: 255.255.255.0
|
||||
servernet: 172.16.254.0
|
||||
servergw: 172.16.254.1
|
||||
servernet: 172.16.253.0
|
||||
servergw: 172.16.253.1
|
||||
serverfqdn: pdc.topolin.ia
|
||||
domainshort: TOPOLIN
|
||||
domainfull: topolin.ia
|
||||
dhcprange_start: 172.16.254.10
|
||||
dhcprange_end: 172.16.254.50
|
||||
sssdrealm: ad.topolin.ia
|
||||
dhcprange_start: 172.16.253.10
|
||||
dhcprange_end: 172.16.253.50
|
||||
extdnsserver1: 208.67.222.222
|
||||
extdnsserver2: 208.67.220.220
|
||||
org_email: info@bglug.it
|
||||
|
2
hosts
2
hosts
@ -2,4 +2,4 @@
|
||||
host_key_checking=false
|
||||
|
||||
[server]
|
||||
172.16.254.1 ansible_ssh_user=amgmt
|
||||
172.16.253.1 ansible_ssh_user=amgmt
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
dependencies:
|
||||
- { role: ubuntu-mirror, tags: [ 'client-install' ] }
|
||||
- { role: mirror, tags: [ 'client-install' ] }
|
||||
- { role: preseed, tags: [ 'client-install' ] }
|
||||
- { role: ansible-pull, tags: [ 'client-install' ] }
|
||||
- { role: doraemon, tags: [ 'client-install' ] }
|
||||
- { role: npm, tags: [ 'client-install' ] }
|
||||
- { role: git-daemon, tags: [ 'client-install' ] }
|
||||
# - { role: ansible-pull, tags: [ 'client-install' ] }
|
||||
# - { role: doraemon, tags: [ 'client-install' ] }
|
||||
# - { role: npm, tags: [ 'client-install' ] }
|
||||
# - { role: git-daemon, tags: [ 'client-install' ] }
|
||||
|
@ -41,7 +41,7 @@
|
||||
shell: pushd /var/lib/git-daemon/repositories/client-pull-installation.git; git fetch -p origin; popd
|
||||
become: yes
|
||||
become_user: git-daemon
|
||||
when: chk_clientpullinstall_repo is succeeded
|
||||
when: chk_clientpullinstall_repo|success
|
||||
tags:
|
||||
- git-daemon-update
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
shell: git clone --mirror {{ client_gitrepo }} /var/lib/git-daemon/repositories/client-pull-installation.git
|
||||
become: yes
|
||||
become_user: git-daemon
|
||||
when: chk_clientpullinstall_repo is changed
|
||||
when: chk_clientpullinstall_repo|changed
|
||||
|
||||
- name: Rendo il repository esportabile
|
||||
file:
|
||||
@ -94,7 +94,7 @@
|
||||
- name: Aggiungo servizio a gestione NethServer
|
||||
shell: /sbin/e-smith/db configuration set git-daemon service status enabled TCPPort 9418 access private
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Creazione directory defaults per NethServer
|
||||
file:
|
||||
@ -102,7 +102,7 @@
|
||||
recurse: yes
|
||||
state: directory
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Creazione tipo default per NethServer
|
||||
lineinfile:
|
||||
@ -112,7 +112,7 @@
|
||||
create: yes
|
||||
state: present
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Creazione stato default per NethServer
|
||||
lineinfile:
|
||||
@ -122,19 +122,19 @@
|
||||
create: yes
|
||||
state: present
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Aggiunta servizio
|
||||
shell: /sbin/e-smith/signal-event runlevel-adjust
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Aggiunta servizio di rete e cambio firewall
|
||||
shell: /sbin/e-smith/signal-event firewall-adjust
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
||||
- name: Avvio servizio
|
||||
shell: service git-daemon start
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv is changed
|
||||
when: chk_gitdaemon_srv|changed
|
||||
|
@ -23,14 +23,14 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
when: chk_mount_nfs is changed
|
||||
when: chk_mount_nfs|changed
|
||||
|
||||
- name: Adding mountpoint to fstab
|
||||
lineinfile:
|
||||
dest: /etc/fstab
|
||||
line: "{{ ansible_local.domain.mirror_nfs_share }} /var/spool/apt-mirror/mirror nfs4 defaults 0 0"
|
||||
when: chk_mount_nfs is changed
|
||||
when: chk_mount_nfs|changed
|
||||
|
||||
- name: Mounting share
|
||||
shell: mount /var/spool/apt-mirror/mirror
|
||||
when: chk_mount_nfs is changed
|
||||
when: chk_mount_nfs|changed
|
7
roles/nethcfg/handlers/main.yml
Normal file
7
roles/nethcfg/handlers/main.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
|
||||
- name: restart httpd-admin
|
||||
service:
|
||||
name: httpd-admin
|
||||
state: restarted
|
||||
become: yes
|
37
roles/nethcfg/tasks/ad.yml
Normal file
37
roles/nethcfg/tasks/ad.yml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
# Installing and configuring AD role
|
||||
|
||||
- name: Verify if br0 exists already
|
||||
shell: /sbin/e-smith/db networks printprop br0 role
|
||||
register: br0_status
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Creating brigde interface to host the dc
|
||||
shell: /sbin/e-smith/db networks set br0 bridge gateway '' ipaddr {{ ansible_local.domain.serverip }} netmask {{ ansible_local.domain.servernetmask }} role green
|
||||
when: '"role=green" not in br0_status.stdout'
|
||||
|
||||
- name: Removing unneded properties from lan0
|
||||
shell: /sbin/e-smith/db networks delprop lan0 ipaddr netmask bootproto
|
||||
when: '"role=green" not in br0_status.stdout'
|
||||
|
||||
- name: Assigning bridge member role for lan0
|
||||
shell: /sbin/e-smith/db networks setprop lan0 bridge br0 role bridged
|
||||
when: '"role=green" not in br0_status.stdout'
|
||||
|
||||
- name: Activating bridge
|
||||
shell: /sbin/e-smith/signal-event interface-update
|
||||
when: '"role=green" not in br0_status.stdout'
|
||||
|
||||
- name: Configuring sssd provider
|
||||
shell: /sbin/e-smith/db configuration setprop sssd Realm {{ ansible_local.domain.sssdrealm | upper }} Workgroup {{ ansible_local.domain.domainshort }}
|
||||
|
||||
- name: Configuring nsdc
|
||||
shell: /sbin/e-smith/db configuration set nsdc service IpAddress {{ ansible_local.domain.nsdc_ipaddress }} ProvisionType newdomain bridge br0 status enabled
|
||||
|
||||
- name: Installing needed packages
|
||||
yum:
|
||||
name: "@nethserver-dc"
|
||||
state: present
|
||||
|
||||
- name: Saving new dc status
|
||||
shell: /sbin/e-smith/signal-event nethserver-dc-update
|
@ -9,27 +9,25 @@
|
||||
state: present
|
||||
tags: nethgui
|
||||
|
||||
# Trusted networks: LAN
|
||||
# Hostname stuff
|
||||
- name: Changing effectively hostname
|
||||
shell: /usr/bin/hostnamectl set-hostname {{ ansible_local.domain.serverfqdn }} --static
|
||||
register: hostnamechg
|
||||
when: "'{{ ansible_hostname }}' != '{{ ansible_local.domain.server }}'"
|
||||
|
||||
- name: Check for LAN to be added as Trusted Network
|
||||
shell: /sbin/e-smith/db networks printprop {{ ansible_local.domain.servernet }} Description
|
||||
register: check_trusted
|
||||
changed_when: '"Description=Local LAN" not in check_trusted.stdout'
|
||||
ignore_errors: yes
|
||||
tags: trustednet
|
||||
- name: Configuring hostname
|
||||
shell: /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
|
||||
when: hostnamechg|changed
|
||||
|
||||
- name: Configuring trusted networks
|
||||
shell: /sbin/e-smith/db networks set {{ ansible_local.domain.servernet }} network Description "Local LAN" Mask {{ ansible_local.domain.servernetmask }}
|
||||
when: check_trusted is changed
|
||||
tags: trustednet
|
||||
- name: Configuring domain name
|
||||
shell: /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
|
||||
when: hostnamechg|changed
|
||||
|
||||
- name: Activating trusted network
|
||||
shell: /sbin/e-smith/signal-event trusted-networks-modify
|
||||
when: check_trusted is changed
|
||||
tags: trustednet
|
||||
|
||||
# Preconfiguring DNS anyways
|
||||
- name: Activating hostname/domainname changes
|
||||
shell: /sbin/e-smith/signal-event hostname-modify
|
||||
when: hostnamechg|changed
|
||||
|
||||
# DNS configuration
|
||||
- name: Checking DNS configuration
|
||||
shell: /sbin/e-smith/db configuration printprop dns NameServers
|
||||
register: chk_dns
|
||||
@ -38,36 +36,14 @@
|
||||
|
||||
- name: Configuring DNS resolution
|
||||
shell: /sbin/e-smith/db configuration setprop dns NameServers {{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}
|
||||
when: chk_dns is changed
|
||||
when: chk_dns|changed
|
||||
tags: dns-preset
|
||||
|
||||
- name: Activating correct DNS resolution
|
||||
shell: "/sbin/e-smith/signal-event nethserver-base-update"
|
||||
when: chk_dns is changed
|
||||
|
||||
# Hostname and domainname
|
||||
|
||||
- name: Configuring hostname
|
||||
shell: /sbin/e-smith/db configuration set SystemName {{ ansible_local.domain.server }}
|
||||
register: chg_hostname
|
||||
when: "'{{ ansible_hostname }}' != '{{ ansible_local.domain.server }}'"
|
||||
tags: hostname
|
||||
|
||||
- name: Configuring domain name
|
||||
shell: /sbin/e-smith/db configuration set DomainName {{ ansible_local.domain.domainfull }}
|
||||
register: chg_domainname
|
||||
when: "'{{ ansible_domain }}' != '{{ ansible_local.domain.domainfull }}'"
|
||||
tags: domainname
|
||||
|
||||
- name: Activating hostname/domainname changes
|
||||
shell: /sbin/e-smith/signal-event hostname-modify
|
||||
when: chg_hostname is changed or chg_domainname is changed
|
||||
tags:
|
||||
- hostname
|
||||
- domainname
|
||||
when: chk_dns|changed
|
||||
|
||||
# Base certificate
|
||||
|
||||
- name: Checking CA configuration
|
||||
shell: /sbin/e-smith/db configuration printprop pki CommonName
|
||||
ignore_errors: true
|
||||
@ -78,9 +54,13 @@
|
||||
- name: Configuring CA
|
||||
shell: /sbin/e-smith/db configuration setprop pki CertificateDuration 3650 CommonName {{ ansible_local.domain.serverfqdn }} CountryCode {{ ansible_local.domain.org_countrycode }} EmailAddress {{ ansible_local.domain.org_email }} Locality "{{ ansible_local.domain.org_city }}" Organization "{{ ansible_local.domain.org_company }}"
|
||||
tags: regen-ca
|
||||
when: chk_crt is changed or force_regen_ca|bool
|
||||
when: chk_crt|changed or force_regen_ca|bool
|
||||
|
||||
- name: Activating CA and regenerate
|
||||
shell: /sbin/e-smith/signal-event certificate-update
|
||||
when: chk_crt is changed or force_regen_ca|bool
|
||||
when: chk_crt|changed or force_regen_ca|bool
|
||||
tags: regen-ca
|
||||
|
||||
- name: Disabling first time wizard
|
||||
shell: /sbin/e-smith/db configuration setprop httpd-admin ForcedLoginModule ""
|
||||
notify: restart httpd-admin
|
||||
|
21
roles/nethcfg/tasks/dhcp.yml
Normal file
21
roles/nethcfg/tasks/dhcp.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
# DHCP
|
||||
- name: Checking DHCP configuration
|
||||
shell: /sbin/e-smith/db dhcp getprop {{ intnic }} DhcpRangeStart
|
||||
ignore_errors: true
|
||||
register: chk_dhcp
|
||||
|
||||
- name: Configuring DHCP
|
||||
shell: /sbin/e-smith/db dhcp set {{ intnic }} range DhcpRangeStart {{ ansible_local.domain.dhcprange_start }} DhcpRangeEnd {{ ansible_local.domain.dhcprange_end }} DhcpDNS {{ ansible_local.domain.serverip }} DhcpDomain {{ ansible_local.domain.domainfull }} DhcpGatewayIP {{ ansible_local.domain.servergw }} DhcpLeaseTime 86400 DhcpNTP {{ ansible_local.domain.serverip }} status enabled
|
||||
when: chk_dhcp|failed
|
||||
|
||||
- name: Activating DHCP
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: chk_dhcp|failed
|
||||
|
||||
# Avahi
|
||||
|
||||
- name: Installing avahi-daemon
|
||||
yum:
|
||||
name: nethserver-avahi
|
||||
state: present
|
@ -1,52 +0,0 @@
|
||||
---
|
||||
# Installing and configuring DHCP and DNS
|
||||
|
||||
- name: Installing DHCP and DNS related NethServer packages.
|
||||
yum:
|
||||
name: nethserver-dnsmasq
|
||||
state: present
|
||||
|
||||
# DHCP
|
||||
|
||||
- name: Checking DHCP configuration
|
||||
shell: /sbin/e-smith/db dhcp getprop {{ intnic }} DhcpRangeStart
|
||||
ignore_errors: true
|
||||
register: chk_dhcp
|
||||
|
||||
- name: Configuring DHCP
|
||||
shell: /sbin/e-smith/db dhcp set {{ intnic }} range DhcpRangeStart {{ ansible_local.domain.dhcprange_start }} DhcpRangeEnd {{ ansible_local.domain.dhcprange_end }} status enabled
|
||||
when: chk_dhcp is failed
|
||||
|
||||
- name: Activating DHCP
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: chk_dhcp is failed
|
||||
|
||||
# DNS
|
||||
# Already preconfigured before (roles/nethcfg/tasks/base.yml)
|
||||
# reforcing the resolver addresses to the ones configured
|
||||
|
||||
- name: Checking DNS configuration
|
||||
shell: /sbin/e-smith/db configuration printprop dns NameServers
|
||||
register: chk_dns
|
||||
changed_when: "'NameServers={{ ansible_local.domain.extdnsserver1 }}' not in chk_dns.stdout"
|
||||
tags: force-resolvers
|
||||
|
||||
- name: Configuring DNS resolution
|
||||
shell: /sbin/e-smith/db configuration setprop dns NameServers {{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}
|
||||
when: chk_dns is changed
|
||||
tags: force-resolvers
|
||||
|
||||
- name: Activating correct DNS resolution
|
||||
shell: "/sbin/e-smith/signal-event nethserver-{{ item }}-update"
|
||||
with_items:
|
||||
- base
|
||||
- dnsmasq
|
||||
when: chk_dns is changed
|
||||
tags: force-resolvers
|
||||
|
||||
# Avahi
|
||||
|
||||
- name: Installing avahi-daemon
|
||||
yum:
|
||||
name: nethserver-avahi
|
||||
state: present
|
@ -1,42 +0,0 @@
|
||||
---
|
||||
# Organization
|
||||
|
||||
- name: Installing required packages
|
||||
yum:
|
||||
pkg: nethserver-directory
|
||||
state: present
|
||||
|
||||
- name: Check organization configuration
|
||||
shell: /sbin/e-smith/db configuration printprop OrganizationContact City
|
||||
register: check_org
|
||||
changed_when: "'City={{ ansible_local.domain.org_city }}' not in check_org.stdout"
|
||||
ignore_errors: yes
|
||||
|
||||
# Password policy
|
||||
|
||||
- name: Check for password policy
|
||||
shell: /sbin/e-smith/db configuration printprop passwordstrength Users
|
||||
register: chk_passstr
|
||||
changed_when: "'Users=none' not in chk_passstr.stdout"
|
||||
ignore_errors: true
|
||||
tags: password-policy
|
||||
|
||||
- name: Configuring password policy
|
||||
shell: /sbin/e-smith/db configuration setprop passwordstrength PassExpires no Users none Admin strong MaxPassAge 180 MinPassAge 0 PassExpires no PassWarning 7
|
||||
when: chk_passstr is changed
|
||||
tags: password-policy
|
||||
|
||||
- name: Activating password policy
|
||||
shell: /sbin/e-smith/signal-event password-policy-update
|
||||
when: chk_passstr is changed
|
||||
tags: password-policy
|
||||
|
||||
# Organization configuration
|
||||
|
||||
- name: Configuring organization
|
||||
shell: /sbin/e-smith/db configuration setprop OrganizationContact City "{{ ansible_local.domain.org_city }}" Company "{{ ansible_local.domain.org_company }}" CountryCode {{ ansible_local.domain.org_countrycode }} Department "{{ ansible_local.domain.org_department }}" PhoneNumber "{{ ansible_local.domain.org_phone }}" Street "{{ ansible_local.domain.org_street }}"
|
||||
when: check_org is changed
|
||||
|
||||
- name: Activating organization configuration
|
||||
shell: /sbin/e-smith/signal-event organization-save
|
||||
when: check_org is changed
|
@ -1,47 +1,24 @@
|
||||
---
|
||||
# Domain groups
|
||||
|
||||
# Domain Users
|
||||
|
||||
- name: domusers - Checking for group
|
||||
shell: /sbin/e-smith/db accounts show domusers
|
||||
register: check_domusers
|
||||
ignore_errors: true
|
||||
|
||||
- name: domusers - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set domusers group Description "Domain Users" Members admin Removable no
|
||||
when: check_domusers is failed
|
||||
|
||||
- name: domusers - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create domusers
|
||||
when: check_domusers is failed
|
||||
|
||||
# Domain Operators
|
||||
|
||||
- name: domopers - Checking for group
|
||||
shell: /sbin/e-smith/db accounts show domopers
|
||||
shell: /bin/getent group domopers
|
||||
register: check_domopers
|
||||
ignore_errors: true
|
||||
|
||||
- name: domopers - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set domopers group Description "Domain Operators" Removable no
|
||||
when: check_domopers is failed
|
||||
|
||||
- name: domopers - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create domopers
|
||||
when: check_domopers is failed
|
||||
when: check_domopers|failed
|
||||
|
||||
# Docenti
|
||||
|
||||
- name: docenti - Checking for group
|
||||
shell: /sbin/e-smith/db accounts show docenti
|
||||
shell: /bin/getent group docenti
|
||||
register: check_docenti
|
||||
ignore_errors: true
|
||||
|
||||
- name: docenti - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set docenti group Description "Docenti" Removable no
|
||||
when: check_docenti is failed
|
||||
|
||||
- name: docenti - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create docenti
|
||||
when: check_docenti is failed
|
||||
when: check_docenti|failed
|
||||
|
@ -18,17 +18,16 @@
|
||||
tags:
|
||||
- ntp
|
||||
|
||||
# Directory and organization
|
||||
- include: directory.yml
|
||||
- include: organization.yml
|
||||
become: yes
|
||||
tags:
|
||||
- directory
|
||||
- organization
|
||||
|
||||
# DHCP and DNS
|
||||
- include: dhcpdns.yml
|
||||
- include: dhcp.yml
|
||||
become: yes
|
||||
tags:
|
||||
- dhcpdns
|
||||
- dhcp
|
||||
|
||||
# Other small services
|
||||
- include: otherservices.yml
|
||||
@ -43,6 +42,19 @@
|
||||
- proxy
|
||||
- webfilter
|
||||
|
||||
# Active directory container
|
||||
- include: ad.yml
|
||||
become: yes
|
||||
tags:
|
||||
- activedirectory
|
||||
- ad
|
||||
|
||||
# Correcting passwordpolicy
|
||||
- include: passwordpolicy.yml
|
||||
become: yes
|
||||
tags:
|
||||
- passwordpolicy
|
||||
|
||||
# SAMBA and ibays
|
||||
- include: samba.yml
|
||||
become: yes
|
||||
|
@ -1,24 +1,33 @@
|
||||
---
|
||||
# Network time protocol
|
||||
|
||||
- name: Installing NTP related packages.
|
||||
yum:
|
||||
name: nethserver-ntp
|
||||
state: present
|
||||
# Timezone
|
||||
- name: Configuring timezone
|
||||
shell: /sbin/e-smith/db configuration set TimeZone "Europe/Rome"
|
||||
register: chg_timezone
|
||||
|
||||
# Configuring same timezone also on php
|
||||
- name: Configuring timezone in PHP
|
||||
shell: /sbin/e-smith/db configuration setprop php DateTimezone "Europe/Rome"
|
||||
register: chg_timezone_php
|
||||
|
||||
- name: Activate timezone in PHP
|
||||
shell: /sbin/e-smith/signal-event nethserver-php-update
|
||||
when: chg_timezone_php|changed
|
||||
|
||||
- name: Checking for NTP Configuration
|
||||
shell: /sbin/e-smith/db configuration printprop ntpd NTPServer
|
||||
shell: /sbin/e-smith/db configuration printprop chronyd NTPServer
|
||||
become: yes
|
||||
register: chk_ntp
|
||||
changed_when: "'NTPServer=ntp1.inrim.it' not in chk_ntp.stdout"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Configuring NTP
|
||||
shell: /sbin/e-smith/db configuration setprop ntpd NTPServer ntp1.inrim.it status enabled
|
||||
shell: /sbin/e-smith/db configuration setprop chronyd NTPServer ntp1.inrim.it status enabled
|
||||
become: yes
|
||||
when: chk_ntp is changed
|
||||
when: chk_ntp|changed
|
||||
|
||||
- name: Activating NTP
|
||||
shell: /sbin/e-smith/signal-event nethserver-ntp-update
|
||||
shell: /sbin/e-smith/signal-event nethserver-ntp-save
|
||||
become: yes
|
||||
when: chk_ntp is changed
|
||||
when: chk_ntp|changed
|
||||
|
16
roles/nethcfg/tasks/organization.yml
Normal file
16
roles/nethcfg/tasks/organization.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
# Organization
|
||||
|
||||
- name: Check organization configuration
|
||||
shell: /sbin/e-smith/db configuration printprop OrganizationContact City
|
||||
register: check_org
|
||||
changed_when: "'City={{ ansible_local.domain.org_city }}' not in check_org.stdout"
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Configuring organization
|
||||
shell: /sbin/e-smith/db configuration setprop OrganizationContact City "{{ ansible_local.domain.org_city }}" Company "{{ ansible_local.domain.org_company }}" CountryCode {{ ansible_local.domain.org_countrycode }} Department "{{ ansible_local.domain.org_department }}" PhoneNumber "{{ ansible_local.domain.org_phone }}" Street "{{ ansible_local.domain.org_street }}"
|
||||
when: check_org|changed
|
||||
|
||||
- name: Activating organization configuration
|
||||
shell: /sbin/e-smith/signal-event organization-save
|
||||
when: check_org|changed
|
@ -3,13 +3,10 @@
|
||||
|
||||
- name: Installing other small services
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- nethserver-cups
|
||||
- nethserver-collectd
|
||||
- nethserver-collectd-web
|
||||
- nethserver-firewall-base
|
||||
- nethserver-firewall-base-ui
|
||||
- nethserver-backup-config
|
||||
- nethserver-backup-data
|
||||
state: present
|
||||
|
19
roles/nethcfg/tasks/passwordpolicy.yml
Normal file
19
roles/nethcfg/tasks/passwordpolicy.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
# Password policy
|
||||
|
||||
- name: Check for password policy
|
||||
shell: /sbin/e-smith/db configuration printprop passwordstrength Users
|
||||
register: chk_passstr
|
||||
changed_when: "'Users=none' not in chk_passstr.stdout"
|
||||
ignore_errors: true
|
||||
tags: password-policy
|
||||
|
||||
- name: Configuring password policy
|
||||
shell: /sbin/e-smith/db configuration setprop passwordstrength PassExpires no Users none MaxPassAge 180 MinPassAge 0 PassWarning 7
|
||||
when: chk_passstr|changed
|
||||
tags: password-policy
|
||||
|
||||
- name: Activating password policy
|
||||
shell: /sbin/e-smith/signal-event password-policy-update
|
||||
when: chk_passstr|changed
|
||||
tags: password-policy
|
@ -1,14 +1,12 @@
|
||||
---
|
||||
# Proxy and webfiltering configurations
|
||||
|
||||
- name: Installing proxy-related packages
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- nethserver-squid
|
||||
- nethserver-squidclamav
|
||||
- nethserver-squidguard
|
||||
state: present
|
||||
|
||||
# Squid
|
||||
|
||||
@ -20,47 +18,55 @@
|
||||
|
||||
- name: Configuring Squid
|
||||
shell: /sbin/e-smith/db configuration setprop squid BlueMode transparent GreenMode transparent PortBlock disabled status enabled DiskCache enabled DiskCacheSize 2000
|
||||
when: chk_squid is changed
|
||||
when: chk_squid|changed
|
||||
|
||||
- name: Activating Squid configuration
|
||||
shell: /sbin/e-smith/signal-event nethserver-squid-update
|
||||
when: chk_squid is changed
|
||||
|
||||
# Squid-clamav
|
||||
|
||||
- name: Checking squidclamav configuration
|
||||
shell: /sbin/e-smith/db configuration printprop squidclamav status
|
||||
ignore_errors: true
|
||||
register: chk_squidclamav
|
||||
changed_when: "'status=enabled' not in chk_squidclamav.stdout"
|
||||
|
||||
- name: Configuring squidclamav
|
||||
shell: /sbin/e-smith/db configuration setprop squidclamav status enabled
|
||||
when: chk_squidclamav is changed
|
||||
|
||||
- name: Activating squidclamav
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidclamav-update
|
||||
when: chk_squidclamav is changed
|
||||
shell: /sbin/e-smith/signal-event nethserver-squid-save
|
||||
when: chk_squid|changed
|
||||
|
||||
# SquidGuard
|
||||
|
||||
- name: Verifying squidguard configuration
|
||||
shell: /sbin/e-smith/db configuration printprop squidguard status
|
||||
register: check_squidguard
|
||||
ignore_errors: true
|
||||
changed_when: '"status=enabled" not in check_squidguard.stdout'
|
||||
|
||||
- name: Checking ufdb configuration
|
||||
shell: /sbin/e-smith/db configuration printprop ufdb status
|
||||
ignore_errors: true
|
||||
register: chk_ufdb
|
||||
changed_when: "'status=enabled' not in check_squidguard.stdout"
|
||||
|
||||
- name: Configuring ufdb
|
||||
shell: /sbin/e-smith/db configuration setprop ufdb status enabled
|
||||
when: check_squidguard|changed
|
||||
|
||||
- name: Configuring squidguard
|
||||
shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla status enabled
|
||||
when: check_squidguard is changed
|
||||
shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla
|
||||
when: check_squidguard|changed
|
||||
|
||||
- name: Activating squidguard configuration
|
||||
shell: "/sbin/e-smith/signal-event nethserver-squidguard-{{ item }}"
|
||||
with_items:
|
||||
- save
|
||||
- update
|
||||
- downloadlists
|
||||
when: check_squidguard is changed
|
||||
when: check_squidguard|changed
|
||||
|
||||
# Squid-clamav
|
||||
|
||||
- name: Checking squidclamav configuration
|
||||
shell: /sbin/e-smith/db configuration printprop clamd@squidclamav status
|
||||
ignore_errors: true
|
||||
register: chk_squidclamav
|
||||
changed_when: "'status=enabled' not in chk_squidclamav.stdout"
|
||||
|
||||
- name: Configuring squidclamav
|
||||
shell: /sbin/e-smith/db configuration setprop clamd@squidclamav status enabled
|
||||
when: chk_squidclamav|changed
|
||||
|
||||
- name: Activating squidclamav
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidclamav-update
|
||||
when: chk_squidclamav|changed
|
||||
|
||||
# Content filtering settings
|
||||
|
||||
@ -70,10 +76,10 @@
|
||||
changed_when: "'sex' not in check_cf.stdout"
|
||||
|
||||
- name: Configuring content filtering
|
||||
shell: /sbin/e-smith/db contentfilter setprop default Categories aggressive,alcohol,weapons,games-online,gamble,dating,webradio,webtv,sex,porn,spyware,violence,anonvpn,warez
|
||||
shell: /sbin/e-smith/db contentfilter setprop default Categories aggressive,alcohol,weapons,games-online,gamble,dating,webradio,webtv,sex,porn,spyware,violence,anonvpn,warez BlackList enabled BlockAll disabled BlockBuiltinRules disabled BlockFileTypes disabled BlockIpAccess enabled
|
||||
register: cf_cat
|
||||
when: check_cf is changed
|
||||
when: check_cf|changed
|
||||
|
||||
- name: Activating content filtering as a whole
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidguard-update
|
||||
when: check_cf is changed
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidguard-save
|
||||
when: check_cf|changed
|
||||
|
@ -4,20 +4,26 @@
|
||||
|
||||
- name: Installing SAMBA and ibays packages
|
||||
yum:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- nethserver-ibays
|
||||
- nethserver-samba
|
||||
name:
|
||||
- "@nethserver-file-server"
|
||||
- nethserver-samba-audit
|
||||
state: present
|
||||
|
||||
# SAMBA
|
||||
|
||||
- name: "Verifying modifications on templates-custom."
|
||||
shell: grep -q 'server signing = mandatory' /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
||||
register: check_tempcust
|
||||
changed_when: check_tempcust.rc != 0
|
||||
ignore_errors: true
|
||||
- name: Checking for default SAMBA behaviour
|
||||
shell: /sbin/e-smith/db configuration getprop smb HomeAdmStatus
|
||||
register: check_smbbehavior
|
||||
changed_when: "'enabled' not in check_smbbehavior"
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Configuring standard SAMBA behaviour on shared folders
|
||||
shell: /sbin/e-smith/db configuration setprop smb HomeAdmStatus enabled InheritOwner yes ShareAdmStatus enabled
|
||||
when: check_smbbehavior|changed
|
||||
|
||||
- name: Activating default SAMBA behaviour
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
||||
when: check_smbbehavior|changed
|
||||
|
||||
- name: "Create directory structure for templates-custom"
|
||||
file:
|
||||
@ -26,7 +32,7 @@
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
when: check_tempcust is changed
|
||||
register: check_tempcust
|
||||
|
||||
- name: "Copying settings from default."
|
||||
copy:
|
||||
@ -36,106 +42,82 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: check_tempcust is changed
|
||||
when: check_tempcust|changed
|
||||
|
||||
- name: "Enabling unix extensions on SAMBA"
|
||||
replace:
|
||||
lineinfile:
|
||||
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
||||
regexp: '^unix extensions = no$'
|
||||
replace: 'unix extensions = yes'
|
||||
when: check_tempcust is changed
|
||||
line: 'unix extensions = yes'
|
||||
state: present
|
||||
insertafter: EOF
|
||||
when: check_tempcust|changed
|
||||
|
||||
- name: Adding server signing as mandatory
|
||||
lineinfile:
|
||||
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
||||
line: "server signing = mandatory"
|
||||
insertafter: "^workgroup = "
|
||||
state: present
|
||||
when: check_tempcust is changed
|
||||
insertafter: EOF
|
||||
when: check_tempcust|changed
|
||||
|
||||
- name: Checking SMB configuration
|
||||
shell: /sbin/e-smith/db configuration printprop smb RoamingProfiles
|
||||
register: chk_smb
|
||||
changed_when: "'RoamingProfiles=yes' not in chk_smb.stdout"
|
||||
ignore_errors: true
|
||||
|
||||
- name: Configuring SMB
|
||||
shell: /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup "{{ ansible_local.domain.domainshort }}" status enabled
|
||||
when: chk_smb is changed
|
||||
|
||||
- name: Activating SMB
|
||||
- name: Applying custom configurations to running SAMBA
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
||||
when: chk_smb is changed
|
||||
become: yes
|
||||
when: check_tempcust|changed
|
||||
|
||||
# ibays
|
||||
|
||||
- name: Enabling SMB services restart when managing ibays
|
||||
file:
|
||||
src: reload
|
||||
dest: "{{ item }}/smb"
|
||||
state: link
|
||||
force: yes
|
||||
with_items:
|
||||
- /etc/e-smith/events/ibay-delete/services2adjust
|
||||
- /etc/e-smith/events/ibay-create/services2adjust
|
||||
- /etc/e-smith/events/ibay-modify/services2adjust
|
||||
|
||||
- name: Checking for shared ibay
|
||||
shell: /sbin/e-smith/db accounts show shared
|
||||
ignore_errors: true
|
||||
register: chk_shared
|
||||
|
||||
- name: Copying default templates for shared template type
|
||||
shell: cp -r /etc/e-smith/templates/etc/samba/smb.conf/ibay-default /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring ibay-shared template structure (directory mask)
|
||||
lineinfile:
|
||||
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
line: 'directory mask = 0775'
|
||||
insertafter: '^create mask'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring force create mode
|
||||
lineinfile:
|
||||
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
line: 'force create mode = 0664'
|
||||
insertafter: '^directory mask'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring force directory mode
|
||||
lineinfile:
|
||||
dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
line: 'force directory mode = 0775'
|
||||
insertafter: '^force create mode'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
#- name: Copying default templates for shared template type
|
||||
# shell: cp -r /etc/e-smith/templates/etc/samba/smb.conf/ibay-default /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared
|
||||
# when: force_ibay_shared|bool or chk_shared|failed
|
||||
#
|
||||
#- name: Configuring ibay-shared template structure (directory mask)
|
||||
# lineinfile:
|
||||
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
# line: 'directory mask = 0775'
|
||||
# insertafter: '^create mask'
|
||||
# state: present
|
||||
# when: force_ibay_shared|bool or chk_shared|failed
|
||||
#
|
||||
#- name: Configuring force create mode
|
||||
# lineinfile:
|
||||
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
# line: 'force create mode = 0664'
|
||||
# insertafter: '^directory mask'
|
||||
# state: present
|
||||
# when: force_ibay_shared|bool or chk_shared|failed
|
||||
#
|
||||
#- name: Configuring force directory mode
|
||||
# lineinfile:
|
||||
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
||||
# line: 'force directory mode = 0775'
|
||||
# insertafter: '^force create mode'
|
||||
# state: present
|
||||
# when: force_ibay_shared|bool or chk_shared|failed
|
||||
|
||||
- name: Configuring shared ibay
|
||||
shell: /sbin/e-smith/db accounts set shared ibay AclRead domusers,domadmins AclWrite domusers,domadmins Description "Cartella condivisa" GroupAccess rw HttpStatus disabled OtherAccess r OwningGroup locals SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus enabled SmbStatus enabled
|
||||
when: chk_shared is failed
|
||||
shell: /sbin/e-smith/db accounts set shared ibay AclRead "" AclWrite "" Description "Cartella condivisa" GroupAccess rw OtherAccess "" OwningGroup "domain users@{{ ansible_local.domain.domainfull }}" SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus enabled SmbShareBrowseable enabled
|
||||
when: chk_shared|failed
|
||||
|
||||
- name: Activating shared ibay
|
||||
shell: /sbin/e-smith/signal-event ibay-create shared
|
||||
become: yes
|
||||
when: chk_shared is failed
|
||||
when: chk_shared|failed
|
||||
|
||||
- name: Changing ibay profile for shared
|
||||
shell: /sbin/e-smith/db accounts setprop shared SmbProfileType shared
|
||||
become: yes
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
#- name: Changing ibay profile for shared
|
||||
# shell: /sbin/e-smith/db accounts setprop shared SmbProfileType shared
|
||||
# become: yes
|
||||
# when: force_ibay_shared|bool or chk_shared|failed
|
||||
|
||||
- name: Saving new version of smb.conf
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
||||
become: yes
|
||||
when: check_tempcust is changed
|
||||
|
||||
- name: Forcing regeneration of smb.conf
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-update
|
||||
become: yes
|
||||
when: force_ibay_shared|bool or chk_shared is failed or check_tempcust is changed
|
||||
#- name: Forcing regeneration of smb.conf
|
||||
# shell: /sbin/e-smith/signal-event nethserver-samba-update
|
||||
# become: yes
|
||||
# when: force_ibay_shared|bool or chk_shared|failed or check_tempcust|changed
|
||||
|
||||
# Fixing issue #3 - Configure sudo access for admin on server for operator
|
||||
# access
|
||||
@ -143,7 +125,7 @@
|
||||
- name: Configuring sudo access for admin account
|
||||
lineinfile:
|
||||
dest: /etc/sudoers.d/admin
|
||||
line: 'admin ALL=(ALL:ALL) NOPASSWD: ALL'
|
||||
line: 'admin@{{ ansible_local.domain.domainfull }} ALL=(ALL) NOPASSWD: ALL'
|
||||
create: yes
|
||||
owner: root
|
||||
group: root
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
- name: Creo directory per certificati
|
||||
file:
|
||||
path: /var/lib/nethserver/ibay/ks/server-ca
|
||||
path: /var/www/html/server-ca
|
||||
state: directory
|
||||
owner: root
|
||||
mode: 0755
|
||||
@ -18,13 +18,13 @@
|
||||
- name: 'Utilizzo cert8.db precedentemente fornito (pulito da FF appena aperto)'
|
||||
copy:
|
||||
src: cert8.db
|
||||
dest: /var/lib/nethserver/ibay/ks/server-ca/cert8.db
|
||||
dest: /var/www/html/server-ca/cert8.db
|
||||
owner: root
|
||||
mode: 0644
|
||||
become: yes
|
||||
|
||||
- name: Integro la CA nel db
|
||||
shell: certutil -A -n "{{ ansible_local.domain.domainfull }}" -t "TCu,Cuw,Tuw" -i /tmp/ca.crt -d /var/lib/nethserver/ibay/ks/server-ca
|
||||
shell: certutil -A -n "{{ ansible_local.domain.domainfull }}" -t "TCu,Cuw,Tuw" -i /tmp/ca.crt -d /var/www/html/server-ca
|
||||
become: yes
|
||||
|
||||
- name: Pulizia
|
||||
@ -32,5 +32,5 @@
|
||||
become: yes
|
||||
with_items:
|
||||
- /tmp/ca.crt
|
||||
- /var/lib/nethserver/ibay/ks/server-ca/key3.db
|
||||
- /var/lib/nethserver/ibay/ks/server-ca/secmod.db
|
||||
- /var/www/html/server-ca/key3.db
|
||||
- /var/www/html/server-ca/secmod.db
|
||||
|
@ -17,8 +17,3 @@
|
||||
- include: firefoxcert.yml
|
||||
tags:
|
||||
- firefox
|
||||
|
||||
- include: paperms.yml
|
||||
tags:
|
||||
- preseed
|
||||
- paperms
|
||||
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
# Installing fixes final fixes for PulseAudio permissions.
|
||||
|
||||
- name: Creating paperms subdir inside ks/preseed share
|
||||
file:
|
||||
path: /var/lib/nethserver/ibay/ks/paperms
|
||||
state: directory
|
||||
owner: root
|
||||
group: locals
|
||||
mode: 0755
|
||||
become: yes
|
||||
|
||||
- name: Deploy template files for paperms
|
||||
template:
|
||||
src: "paperms/{{ item }}"
|
||||
dest: "/var/lib/nethserver/ibay/ks/paperms/{{ item }}"
|
||||
owner: root
|
||||
group: locals
|
||||
mode: 0644
|
||||
with_items:
|
||||
- updategrp.py
|
||||
- paperms.sh
|
||||
- cronjob
|
||||
- logrotate
|
||||
become: yes
|
@ -5,44 +5,39 @@
|
||||
edu_package: "{{ ansible_local.domain.edu_package }}"
|
||||
when: ansible_local.domain.edu_package is defined
|
||||
|
||||
- name: Verifica configurazione ibay preseed
|
||||
shell: /sbin/e-smith/db accounts show ks
|
||||
register: chk_ks_created
|
||||
changed_when: chk_ks_created.rc != 0
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
# Since NS7 web folders are not anymore managed using ibays.
|
||||
# I have to correct the issue creating manual folder and assigning correct
|
||||
# permissions.
|
||||
|
||||
- name: Configurazione web preseed
|
||||
shell: /sbin/e-smith/db accounts set ks ibay Description "Preseed share" GroupAccess rw HttpAccess private HttpAliasType default HttpAllowOverrideStatus disabled HttpForceSslStatus disabled HttpPasswordStatus disabled HttpStatus enabled HttpVirtualHost __ANY__ OtherAccess r OwningGroup locals SmbAuditStatus disabled SmbStatus disabled
|
||||
when: chk_ks_created is failed
|
||||
become: yes
|
||||
|
||||
- name: Attivazione web preseed
|
||||
shell: /sbin/e-smith/signal-event ibay-create ks
|
||||
when: chk_ks_created is failed
|
||||
become: yes
|
||||
|
||||
- name: Verifica presenza directory mirror
|
||||
file: path=/var/spool/apt-mirror/mirror state=directory
|
||||
register: chk_mirror_dir
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
- name: Creating the kickstart folder
|
||||
file:
|
||||
path: /var/www/html/ks
|
||||
state: directory
|
||||
owner: root
|
||||
group: locals
|
||||
mode: 0755
|
||||
|
||||
- name: Collegamento directory mirror
|
||||
file: path=/var/lib/nethserver/ibay/ks/mirror src=/var/spool/apt-mirror/mirror state=link
|
||||
file:
|
||||
path: /var/www/html/ks/mirror
|
||||
src: /var/spool/apt-mirror/mirror
|
||||
state: link
|
||||
become: yes
|
||||
when: chk_mirror_dir is succeeded
|
||||
when: ansible_local.domain.mirror_mode == 'local' or ansible_local.domain.mirror_mode == 'nfs'
|
||||
|
||||
- name: Creazione directory preseed
|
||||
file:
|
||||
path: "/var/lib/nethserver/ibay/ks/preseed"
|
||||
path: "/var/www/html/ks/preseed"
|
||||
state: directory
|
||||
owner: root
|
||||
group: local
|
||||
mode: 0755
|
||||
become: yes
|
||||
|
||||
- name: Copia profili preseed
|
||||
template:
|
||||
src: 'preseed/{{ item }}'
|
||||
dest: '/var/lib/nethserver/ibay/ks/preseed/{{ item }}'
|
||||
dest: '/var/www/html/ks/preseed/{{ item }}'
|
||||
with_items:
|
||||
- edubuntu.seed
|
||||
- client-trusty.seed
|
||||
@ -53,13 +48,13 @@
|
||||
- block:
|
||||
- name: Creating development directory
|
||||
file:
|
||||
path: "/var/lib/nethserver/ibay/ks/preseed/dev"
|
||||
path: "/var/www/html/ks/preseed/dev"
|
||||
state: directory
|
||||
|
||||
- name: Preseeding profiles - development
|
||||
template:
|
||||
src: 'preseed/dev/{{ item }}'
|
||||
dest: '/var/lib/nethserver/ibay/ks/preseed/dev/{{ item }}'
|
||||
dest: '/var/www/html/ks/preseed/dev/{{ item }}'
|
||||
with_items:
|
||||
- client-trusty.seed
|
||||
- docenti-trusty.seed
|
||||
@ -69,10 +64,11 @@
|
||||
- name: Copia script post-installazione
|
||||
template:
|
||||
src: 'preseed/{{ item }}'
|
||||
dest: '/var/lib/nethserver/ibay/ks/preseed/{{ item }}'
|
||||
dest: '/var/www/html/ks/preseed/{{ item }}'
|
||||
with_items:
|
||||
- postseed-client.sh
|
||||
- postseed-docenti.sh
|
||||
- postseed-aula.sh
|
||||
- pulseaudio-perms.sh
|
||||
- checksum.fact
|
||||
become: yes
|
||||
|
@ -5,31 +5,31 @@
|
||||
|
||||
- name: Creating base directory for storing repositories files
|
||||
file:
|
||||
path: /var/lib/nethserver/ibay/ks/repoconfig
|
||||
path: /var/www/html/repoconfig
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
group: locals
|
||||
mode: 0755
|
||||
become: yes
|
||||
|
||||
- name: Preconfiguring base repositories file for clients
|
||||
template:
|
||||
src: repoconfig/sources.list
|
||||
dest: /var/lib/nethserver/ibay/ks/repoconfig/sources.list
|
||||
dest: /var/www/html/repoconfig/sources.list
|
||||
owner: root
|
||||
group: root
|
||||
group: locals
|
||||
mode: 0644
|
||||
become: yes
|
||||
|
||||
- name: Preconfiguring other repositories for clients
|
||||
template:
|
||||
src: "repoconfig/{{ item }}"
|
||||
dest: "/var/lib/nethserver/ibay/ks/repoconfig/{{ item }}"
|
||||
dest: "/var/www/html/repoconfig/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
group: locals
|
||||
mode: 0644
|
||||
with_items:
|
||||
- bglug-trusty.list
|
||||
- libreschool-trusty.list
|
||||
- ansible-ansible-trusty.list
|
||||
- libreoffice-ppa-trusty.list
|
||||
- epoptes-ppa-trusty.list
|
||||
@ -39,6 +39,6 @@
|
||||
- name: Pre-downloading geogebra GPG signature because of HTTPS
|
||||
get_url:
|
||||
url: "https://www.geogebra.net/linux/office@geogebra.org.gpg.key"
|
||||
dest: "/var/lib/nethserver/ibay/ks/repoconfig/office_geogebra.gpg.key"
|
||||
dest: "/var/www/html/repoconfig/office_geogebra.gpg.key"
|
||||
validate_certs: no
|
||||
become: yes
|
||||
|
@ -1 +0,0 @@
|
||||
@reboot root /var/lib/{{ ansible_local.domain.domainfull }}/bin/paperms.sh >> /var/log/paperms.log 2>&1
|
@ -1,7 +0,0 @@
|
||||
/var/log/paperms.log {
|
||||
rotate 7
|
||||
daily
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Fixing base variables
|
||||
basedir=/var/lib/{{ ansible_local.domain.domainfull }}
|
||||
|
||||
# Making sure destination folder exists.
|
||||
/usr/bin/install -d -o root -g users ${basedir}/bin
|
||||
|
||||
# Update this script itself
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/paperms/paperms.sh -O ${basedir}/bin/paperms.sh
|
||||
/bin/chown root:users ${basedir}/bin/paperms.sh
|
||||
/bin/chmod a+x ${basedir}/bin/paperms.sh
|
||||
|
||||
# Updating cronjob
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/paperms/cronjob -O /etc/cron.d/paperms
|
||||
/bin/chown root:root /etc/cron.d/paperms
|
||||
/bin/chmod 0644 /etc/cron.d/paperms
|
||||
|
||||
# Removing old versions of the cronjob
|
||||
rm -f /etc/cron.d/pulseaudio-perms
|
||||
|
||||
# Updating logrotate
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/paperms/logrotate -O /etc/logrotate.d/paperms
|
||||
/bin/chown root:root /etc/logrotate.d/paperms
|
||||
/bin/chmod 0644 /etc/logrotate.d/paperms
|
||||
|
||||
# Updating updategrp.py
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/paperms/updategrp.py -O ${basedir}/bin/updategrp.py
|
||||
/bin/chown root:users ${basedir}/bin/updategrp.py
|
||||
/bin/chmod a+x ${basedir}/bin/updategrp.py
|
||||
|
||||
# Main part: run updategrp.py
|
||||
/usr/bin/wbinfo -t && /usr/bin/python2 ${basedir}/bin/updategrp.py "domain users" "pulse" || echo "Not in domain."
|
||||
/usr/bin/wbinfo -t && /usr/bin/python2 ${basedir}/bin/updategrp.py "domain users" "pulse-access" || echo "Not in domain."
|
@ -1,74 +0,0 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
from __future__ import print_function
|
||||
import grp
|
||||
import re
|
||||
from subprocess import check_output
|
||||
from sys import argv
|
||||
|
||||
class UpdateGrp:
|
||||
|
||||
def __init__(self, leftname = "domain users", rightname = "pulse"):
|
||||
"""Confronts members of the LHS group with the members of the RHS group. LHS group defaults to "domain users"."""
|
||||
self.leftname = leftname
|
||||
self.rightname = rightname
|
||||
self.leftmembers = grp.getgrnam(self.leftname)[3]
|
||||
self.rightmembers = grp.getgrnam(self.rightname)[3]
|
||||
|
||||
# Since there is also a local user already created on the machine but
|
||||
# it is not a domain user, we will add it to leftmembers
|
||||
self.leftmembers.append("bglug")
|
||||
|
||||
self.to_add = list(set(self.leftmembers) - set(self.rightmembers))
|
||||
self.to_remove = list(set(self.rightmembers) - set(self.leftmembers))
|
||||
|
||||
def update_rhs(self):
|
||||
"""Updates the RHS group members to be equal to the LHS group members."""
|
||||
# If RHS is a local group
|
||||
with open('/etc/group', 'r') as group:
|
||||
for grp in group.readlines():
|
||||
if re.match("%s:" % self.rightname, grp):
|
||||
# If to_add is not empty, add each element to group
|
||||
if len(self.to_add) > 0:
|
||||
for user in self.to_add:
|
||||
print(check_output(["gpasswd", "-a", user, self.rightname]), end='')
|
||||
|
||||
# If to_remove is not empty, remove each element to group
|
||||
if len(self.to_remove) > 0:
|
||||
for user in self.to_remove:
|
||||
print(check_output(["gpasswd", "-d", user, self.rightname]), end='')
|
||||
|
||||
def update_lhs(self):
|
||||
"""Updates the LHS group members to be equal to the RHS group members."""
|
||||
# If LHS is a local group
|
||||
with open('/etc/group', 'r') as group:
|
||||
for grp in group.readline():
|
||||
if re.match("%s:" % self.leftname, grp):
|
||||
# If to_remove is not empty, add each element to group
|
||||
if len(self.to_remove) > 0:
|
||||
for user in self.to_remove:
|
||||
print(check_output(["gpasswd", "-a", user, self.leftname]), end='')
|
||||
|
||||
# If to_add is not empty, remove each element to group
|
||||
if len(self.to_add) > 0:
|
||||
for user in self.to_add:
|
||||
print(check_output(["gpasswd", "-d", user, self.leftname]), end='')
|
||||
|
||||
|
||||
def modprint(self):
|
||||
"""Debug function to print only modifications."""
|
||||
print("To add: ", end='')
|
||||
print(self.to_add)
|
||||
print("To remove: ", end='')
|
||||
print(self.to_remove)
|
||||
|
||||
# When run interactively
|
||||
if __name__ == '__main__':
|
||||
# If the first argument is '--help' or '-h', or number of arguments less than 1 and more than 2, print help.
|
||||
if len(argv) < 2 or len(argv) > 3 or argv[1] == '--help' or argv[1] == '-h':
|
||||
print("Usage: %s <LHSgroup> <RHSgroup>" % argv[0])
|
||||
print("Aligns RHS group members as LHS.")
|
||||
|
||||
else:
|
||||
updgrp = UpdateGrp(argv[1], argv[2])
|
||||
updgrp.update_rhs()
|
27
roles/preseed/templates/preseed/pulseaudio-perms.sh
Executable file
27
roles/preseed/templates/preseed/pulseaudio-perms.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
domaingroup="domain users"
|
||||
localgroups="pulse pulse-access"
|
||||
|
||||
baseusers="bglug"
|
||||
domainusers="$(getent group "${domaingroup}" | awk 'BEGIN { FS = ":" } ; { print $4 }' | sed -e 's/,/ /g')"
|
||||
|
||||
users="${baseusers} ${domainusers}"
|
||||
|
||||
for group in ${localgroups}; do
|
||||
actualusers=$(getent group '${group}' | awk 'BEGIN { FS = ":" }; { print $4 }' | sed -e 's/,/ /g')
|
||||
|
||||
# Removing users not in the group
|
||||
for user in ${actualusers}; do
|
||||
whuser=${user//[[:space:]]/}
|
||||
echo "removing ${user}"
|
||||
[[ "${users}" =~ "${whuser}" ]] || gpasswd -d "${whuser}" "${group}"
|
||||
unset whuser
|
||||
done
|
||||
|
||||
# Adding users to group
|
||||
for user in ${users}; do
|
||||
whuser=${user//[[:space:]]/}
|
||||
[[ "${actualusers}" =~ "${whuser}" ]] || gpasswd -a "${whuser}" "${group}"
|
||||
done
|
||||
done
|
@ -1,10 +1,7 @@
|
||||
---
|
||||
# TFTP
|
||||
|
||||
- name: Installing TFTP
|
||||
yum:
|
||||
name: nethserver-tftp
|
||||
state: present
|
||||
# TFTP is included in DHCP module in NethServer 7
|
||||
|
||||
- name: Checking TFTP configuration
|
||||
shell: /sbin/e-smith/db configuration getprop dnsmasq dhcp-boot
|
||||
@ -13,9 +10,9 @@
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Configuring TFTP
|
||||
shell: /sbin/e-smith/db configuration setprop dnsmasq tftp-status enabled dhcp-boot pxelinux.0
|
||||
when: chk_tftp_enabled is changed
|
||||
shell: /sbin/e-smith/db configuration setprop dnsmasq dhcp-boot pxelinux.0
|
||||
when: chk_tftp_enabled|changed
|
||||
|
||||
- name: Activating tftp
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: chk_tftp_enabled is changed
|
||||
when: chk_tftp_enabled|changed
|
||||
|
@ -7,29 +7,21 @@
|
||||
state: absent
|
||||
become: yes
|
||||
|
||||
- name: Forcing recreation of {{ extnic }}
|
||||
shell: "INTERFACE=eth0 MATCHADDR={{ ansible_eth0.macaddress }} INTERFACE_NAME={{ extnic }} /lib/udev/write_net_rules"
|
||||
become: yes
|
||||
|
||||
- name: Forcing recreation of {{ intnic }}
|
||||
shell: "INTERFACE=eth1 MATCHADDR={{ ansible_eth1.macaddress }} INTERFACE_NAME={{ intnic }} /lib/udev/write_net_rules"
|
||||
become: yes
|
||||
|
||||
- name: Pulizia vecchie interfacce
|
||||
- name: Removing old interfaces from db networks
|
||||
shell: "/sbin/e-smith/db networks delete {{ item }}"
|
||||
become: yes
|
||||
with_items:
|
||||
- eth0
|
||||
- eth1
|
||||
|
||||
- name: Creo interfaccia esterna in NethServer
|
||||
shell: /sbin/e-smith/db networks set {{ extnic }} ethernet bootproto dhcp device {{ extnic }} hwaddr {{ ansible_eth0.macaddress }} onboot yes peerdns yes role red
|
||||
- name: Configuring new external interface
|
||||
shell: "/sbin/e-smith/db networks set {{ extnic }} ethernet bootproto dhcp device {{ extnic }} hwaddr {{ ansible_eth0.macaddress }} onboot yes role red"
|
||||
become: yes
|
||||
|
||||
- name: Creo interfaccia interna in NethServer
|
||||
shell: /sbin/e-smith/db networks set {{ intnic }} ethernet bootproto none device {{ intnic }} hwaddr {{ ansible_eth1.macaddress }} ipaddr 172.16.254.1 netmask 255.255.255.0 onboot yes role green
|
||||
- name: Configuring new internal interface
|
||||
shell: "/sbin/e-smith/db networks set {{ intnic }} ethernet bootproto none device {{ intnic }} hwaddr {{ ansible_eth1.macaddress }} ipaddr 172.16.253.1 netmask 255.255.255.0 onboot yes role green"
|
||||
become: yes
|
||||
|
||||
- name: Trigger interfaces configuration
|
||||
shell: "ifdown eth0; ifdown eth1; udevadm control --reload-rules && udevadm trigger; /sbin/e-smith/signal-event interface-update"
|
||||
- name: Trigger interfaces configuration change
|
||||
shell: "ip link set eth0 down; ip link set eth0 name {{ extnic }}; ip link set eth1 down; ip link set eth1 name {{ intnic }}; /sbin/e-smith/signal-event interface-update; /sbin/e-smith/signal-event firewall-adjust"
|
||||
become: yes
|
||||
|
@ -10,22 +10,6 @@
|
||||
become: yes
|
||||
tags: ansible
|
||||
|
||||
- name: Checking for python-argparse
|
||||
shell: rpm -q python-argparse
|
||||
become: yes
|
||||
register: check_argparse
|
||||
ignore_errors: yes
|
||||
changed_when: "check_argparse.rc == 1"
|
||||
tags: ansible
|
||||
|
||||
- name: Installazione python-argparse
|
||||
yum:
|
||||
name: python-argparse
|
||||
state: present
|
||||
become: yes
|
||||
when: check_argparse is changed
|
||||
tags: ansible
|
||||
|
||||
#- name: Download della gestione client con ansible
|
||||
# git:
|
||||
# repo: "https://github.com/bglug-it/ps-clientmgmt.git"
|
||||
|
@ -1,39 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Verifica abilitazione repo Extra
|
||||
shell: yum repolist
|
||||
register: check_epel
|
||||
failed_when: "'Extra Packages for Enterprise Linux 6' not in check_epel.stdout"
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Installo epel-release
|
||||
yum: name=epel-release state=present
|
||||
become: yes
|
||||
when: check_epel is failed
|
||||
register: epel_installed
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Installo epel-release da URL
|
||||
yum:
|
||||
name: "http://dl.fedoraproject.org/pub/epel/6/{{ ansible_architecture }}/epel-release-6-8.noarch.rpm"
|
||||
state: present
|
||||
become: yes
|
||||
when: epel_installed is failed
|
||||
register: rpm_epel_installed
|
||||
|
||||
- name: Abilito il repo EPEL
|
||||
shell: yum-config-manager --enable epel
|
||||
become: yes
|
||||
when: epel_installed is changed or epel_installed is succeeded or rpm_epel_installed is changed
|
||||
changed_when: "'[epel]' in epel_enabled.stdout and epel_enabled.rc == 0"
|
||||
register: epel_enabled
|
||||
|
||||
- name: Pulizia e ricaricam. repo
|
||||
shell: yum clean all && yum repolist
|
||||
become: yes
|
||||
when: epel_enabled is changed
|
||||
tags: repo
|
||||
|
||||
- name: Aggiorno il sistema
|
||||
yum: name=* state=latest
|
||||
become: yes
|
||||
|
7
roles/setup/tasks/libreschool-repo.yml
Normal file
7
roles/setup/tasks/libreschool-repo.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
# We should install here the LibreSchool repos.
|
||||
|
||||
- name: Install LibreSchool package repo
|
||||
yum:
|
||||
url: "https://repo.libreschool.org/nethserver/7/base/x86_64/Packages/libreschool-release-1.0-1.noarch.rpm"
|
||||
state: present
|
@ -15,4 +15,4 @@
|
||||
|
||||
- name: Locking nethserver-release version
|
||||
shell: yum versionlock add nethserver-release
|
||||
when: chk_locked_nethrelease is changed
|
||||
when: chk_locked_nethrelease|changed
|
||||
|
@ -8,14 +8,12 @@
|
||||
tags: lock-nethrelease
|
||||
|
||||
- include: centos_pkgs.yml
|
||||
when: ansible_distribution == "CentOS" and ansible_os_family == "RedHat"
|
||||
tags: centos
|
||||
|
||||
- include: pvtrepo.yml
|
||||
tags: bglug
|
||||
#- include: libreschool-repo.yml
|
||||
# tags: libreschool
|
||||
|
||||
- include: ansible.yml
|
||||
when: ansible_distribution == "CentOS"
|
||||
tags:
|
||||
- git
|
||||
- ansible
|
||||
|
@ -1,10 +0,0 @@
|
||||
---
|
||||
- name: Installazione istruzioni per repo.bglug.it
|
||||
copy:
|
||||
src: bglug.repo
|
||||
dest: /etc/yum.repos.d/bglug.repo
|
||||
become: yes
|
||||
|
||||
- name: Ricalcolo repository disponibili
|
||||
shell: yum repolist
|
||||
become: yes
|
@ -7,7 +7,7 @@
|
||||
|
||||
- name: Creazione directory .ssh
|
||||
shell: mkdir -p $HOME/.ssh
|
||||
when: check_sshdir is failed
|
||||
when: check_sshdir|failed
|
||||
|
||||
- name: Verifica chiave ssh
|
||||
shell: test -f $HOME/.ssh/id_rsa
|
||||
@ -17,4 +17,4 @@
|
||||
|
||||
- name: Gestione creazione chiave ssh
|
||||
shell: ssh-keygen -t rsa -b 1024 -f $HOME/.ssh/id_rsa -N ''
|
||||
when: check_key is failed
|
||||
when: check_key|failed
|
||||
|
Loading…
x
Reference in New Issue
Block a user