forked from LibreSchool/server-config
Update checks for latest versions of Ansible.
This commit is contained in:
parent
a2e013674b
commit
6ebfc5a91e
2
hosts
2
hosts
@ -2,4 +2,4 @@
|
||||
host_key_checking=false
|
||||
|
||||
[server]
|
||||
172.16.254.1 ansible_ssh_user=amgmt
|
||||
192.168.7.1 ansible_ssh_user=amgmt
|
||||
|
@ -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|success
|
||||
when: chk_clientpullinstall_repo is succeeded
|
||||
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|changed
|
||||
when: chk_clientpullinstall_repo is 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|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Creazione directory defaults per NethServer
|
||||
file:
|
||||
@ -102,7 +102,7 @@
|
||||
recurse: yes
|
||||
state: directory
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Creazione tipo default per NethServer
|
||||
lineinfile:
|
||||
@ -112,7 +112,7 @@
|
||||
create: yes
|
||||
state: present
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Creazione stato default per NethServer
|
||||
lineinfile:
|
||||
@ -122,19 +122,19 @@
|
||||
create: yes
|
||||
state: present
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Aggiunta servizio
|
||||
shell: /sbin/e-smith/signal-event runlevel-adjust
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Aggiunta servizio di rete e cambio firewall
|
||||
shell: /sbin/e-smith/signal-event firewall-adjust
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
||||
- name: Avvio servizio
|
||||
shell: service git-daemon start
|
||||
become: yes
|
||||
when: chk_gitdaemon_srv|changed
|
||||
when: chk_gitdaemon_srv is changed
|
||||
|
@ -20,12 +20,12 @@
|
||||
|
||||
- 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|changed
|
||||
when: check_trusted is changed
|
||||
tags: trustednet
|
||||
|
||||
- name: Activating trusted network
|
||||
shell: /sbin/e-smith/signal-event trusted-networks-modify
|
||||
when: check_trusted|changed
|
||||
when: check_trusted is changed
|
||||
tags: trustednet
|
||||
|
||||
# Preconfiguring DNS anyways
|
||||
@ -38,12 +38,12 @@
|
||||
|
||||
- name: Configuring DNS resolution
|
||||
shell: /sbin/e-smith/db configuration setprop dns NameServers {{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}
|
||||
when: chk_dns|changed
|
||||
when: chk_dns is changed
|
||||
tags: dns-preset
|
||||
|
||||
- name: Activating correct DNS resolution
|
||||
shell: "/sbin/e-smith/signal-event nethserver-base-update"
|
||||
when: chk_dns|changed
|
||||
when: chk_dns is changed
|
||||
|
||||
# Hostname and domainname
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
- name: Activating hostname/domainname changes
|
||||
shell: /sbin/e-smith/signal-event hostname-modify
|
||||
when: chg_hostname|changed or chg_domainname|changed
|
||||
when: chg_hostname is changed or chg_domainname is changed
|
||||
tags:
|
||||
- hostname
|
||||
- domainname
|
||||
@ -78,9 +78,9 @@
|
||||
- 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|changed or force_regen_ca|bool
|
||||
when: chk_crt is changed or force_regen_ca|bool
|
||||
|
||||
- name: Activating CA and regenerate
|
||||
shell: /sbin/e-smith/signal-event certificate-update
|
||||
when: chk_crt|changed or force_regen_ca|bool
|
||||
when: chk_crt is changed or force_regen_ca|bool
|
||||
tags: regen-ca
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
- 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|failed
|
||||
when: chk_dhcp is failed
|
||||
|
||||
- name: Activating DHCP
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: chk_dhcp|failed
|
||||
when: chk_dhcp is failed
|
||||
|
||||
# DNS
|
||||
# Already preconfigured before (roles/nethcfg/tasks/base.yml)
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
- name: Configuring DNS resolution
|
||||
shell: /sbin/e-smith/db configuration setprop dns NameServers {{ ansible_local.domain.extdnsserver1 }},{{ ansible_local.domain.extdnsserver2 }}
|
||||
when: chk_dns|changed
|
||||
when: chk_dns is changed
|
||||
tags: force-resolvers
|
||||
|
||||
- name: Activating correct DNS resolution
|
||||
@ -41,7 +41,7 @@
|
||||
with_items:
|
||||
- base
|
||||
- dnsmasq
|
||||
when: chk_dns|changed
|
||||
when: chk_dns is changed
|
||||
tags: force-resolvers
|
||||
|
||||
# Avahi
|
||||
|
@ -23,20 +23,20 @@
|
||||
|
||||
- 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|changed
|
||||
when: chk_passstr is changed
|
||||
tags: password-policy
|
||||
|
||||
- name: Activating password policy
|
||||
shell: /sbin/e-smith/signal-event password-policy-update
|
||||
when: chk_passstr|changed
|
||||
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|changed
|
||||
when: check_org is changed
|
||||
|
||||
- name: Activating organization configuration
|
||||
shell: /sbin/e-smith/signal-event organization-save
|
||||
when: check_org|changed
|
||||
when: check_org is changed
|
||||
|
@ -10,11 +10,11 @@
|
||||
|
||||
- name: domusers - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set domusers group Description "Domain Users" Members admin Removable no
|
||||
when: check_domusers|failed
|
||||
when: check_domusers is failed
|
||||
|
||||
- name: domusers - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create domusers
|
||||
when: check_domusers|failed
|
||||
when: check_domusers is failed
|
||||
|
||||
# Domain Operators
|
||||
|
||||
@ -25,11 +25,11 @@
|
||||
|
||||
- name: domopers - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set domopers group Description "Domain Operators" Removable no
|
||||
when: check_domopers|failed
|
||||
when: check_domopers is failed
|
||||
|
||||
- name: domopers - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create domopers
|
||||
when: check_domopers|failed
|
||||
when: check_domopers is failed
|
||||
|
||||
# Docenti
|
||||
|
||||
@ -40,8 +40,8 @@
|
||||
|
||||
- name: docenti - Creating new group
|
||||
shell: /sbin/e-smith/db accounts set docenti group Description "Docenti" Removable no
|
||||
when: check_docenti|failed
|
||||
when: check_docenti is failed
|
||||
|
||||
- name: docenti - Activating group
|
||||
shell: /sbin/e-smith/signal-event group-create docenti
|
||||
when: check_docenti|failed
|
||||
when: check_docenti is failed
|
||||
|
@ -16,9 +16,9 @@
|
||||
- name: Configuring NTP
|
||||
shell: /sbin/e-smith/db configuration setprop ntpd NTPServer ntp1.inrim.it status enabled
|
||||
become: yes
|
||||
when: chk_ntp|changed
|
||||
when: chk_ntp is changed
|
||||
|
||||
- name: Activating NTP
|
||||
shell: /sbin/e-smith/signal-event nethserver-ntp-update
|
||||
become: yes
|
||||
when: chk_ntp|changed
|
||||
when: chk_ntp is changed
|
||||
|
@ -20,11 +20,11 @@
|
||||
|
||||
- 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|changed
|
||||
when: chk_squid is changed
|
||||
|
||||
- name: Activating Squid configuration
|
||||
shell: /sbin/e-smith/signal-event nethserver-squid-update
|
||||
when: chk_squid|changed
|
||||
when: chk_squid is changed
|
||||
|
||||
# Squid-clamav
|
||||
|
||||
@ -36,11 +36,11 @@
|
||||
|
||||
- name: Configuring squidclamav
|
||||
shell: /sbin/e-smith/db configuration setprop squidclamav status enabled
|
||||
when: chk_squidclamav|changed
|
||||
when: chk_squidclamav is changed
|
||||
|
||||
- name: Activating squidclamav
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidclamav-update
|
||||
when: chk_squidclamav|changed
|
||||
when: chk_squidclamav is changed
|
||||
|
||||
# SquidGuard
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
- name: Configuring squidguard
|
||||
shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla status enabled
|
||||
when: check_squidguard|changed
|
||||
when: check_squidguard is changed
|
||||
|
||||
- name: Activating squidguard configuration
|
||||
shell: "/sbin/e-smith/signal-event nethserver-squidguard-{{ item }}"
|
||||
@ -60,7 +60,7 @@
|
||||
- save
|
||||
- update
|
||||
- downloadlists
|
||||
when: check_squidguard|changed
|
||||
when: check_squidguard is changed
|
||||
|
||||
# Content filtering settings
|
||||
|
||||
@ -72,8 +72,8 @@
|
||||
- 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
|
||||
register: cf_cat
|
||||
when: check_cf|changed
|
||||
when: check_cf is changed
|
||||
|
||||
- name: Activating content filtering as a whole
|
||||
shell: /sbin/e-smith/signal-event nethserver-squidguard-update
|
||||
when: check_cf|changed
|
||||
when: check_cf is changed
|
||||
|
@ -26,7 +26,7 @@
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
when: check_tempcust|changed
|
||||
when: check_tempcust is changed
|
||||
|
||||
- name: "Copying settings from default."
|
||||
copy:
|
||||
@ -36,14 +36,14 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: check_tempcust|changed
|
||||
when: check_tempcust is changed
|
||||
|
||||
- name: "Enabling unix extensions on SAMBA"
|
||||
replace:
|
||||
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
||||
regexp: '^unix extensions = no$'
|
||||
replace: 'unix extensions = yes'
|
||||
when: check_tempcust|changed
|
||||
when: check_tempcust is changed
|
||||
|
||||
- name: Adding server signing as mandatory
|
||||
lineinfile:
|
||||
@ -51,7 +51,7 @@
|
||||
line: "server signing = mandatory"
|
||||
insertafter: "^workgroup = "
|
||||
state: present
|
||||
when: check_tempcust|changed
|
||||
when: check_tempcust is changed
|
||||
|
||||
- name: Checking SMB configuration
|
||||
shell: /sbin/e-smith/db configuration printprop smb RoamingProfiles
|
||||
@ -61,11 +61,11 @@
|
||||
|
||||
- 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|changed
|
||||
when: chk_smb is changed
|
||||
|
||||
- name: Activating SMB
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
||||
when: chk_smb|changed
|
||||
when: chk_smb is changed
|
||||
|
||||
# ibays
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
|
||||
- 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
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring ibay-shared template structure (directory mask)
|
||||
lineinfile:
|
||||
@ -95,7 +95,7 @@
|
||||
line: 'directory mask = 0775'
|
||||
insertafter: '^create mask'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared|failed
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring force create mode
|
||||
lineinfile:
|
||||
@ -103,7 +103,7 @@
|
||||
line: 'force create mode = 0664'
|
||||
insertafter: '^directory mask'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared|failed
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Configuring force directory mode
|
||||
lineinfile:
|
||||
@ -111,31 +111,31 @@
|
||||
line: 'force directory mode = 0775'
|
||||
insertafter: '^force create mode'
|
||||
state: present
|
||||
when: force_ibay_shared|bool or chk_shared|failed
|
||||
when: force_ibay_shared|bool or chk_shared is 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|failed
|
||||
when: chk_shared is failed
|
||||
|
||||
- name: Activating shared ibay
|
||||
shell: /sbin/e-smith/signal-event ibay-create shared
|
||||
become: yes
|
||||
when: chk_shared|failed
|
||||
when: 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
|
||||
when: force_ibay_shared|bool or chk_shared is failed
|
||||
|
||||
- name: Saving new version of smb.conf
|
||||
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
||||
become: yes
|
||||
when: check_tempcust|changed
|
||||
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|failed or check_tempcust|changed
|
||||
when: force_ibay_shared|bool or chk_shared is failed or check_tempcust is changed
|
||||
|
||||
# Fixing issue #3 - Configure sudo access for admin on server for operator
|
||||
# access
|
||||
|
@ -14,12 +14,12 @@
|
||||
|
||||
- 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|failed
|
||||
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|failed
|
||||
when: chk_ks_created is failed
|
||||
become: yes
|
||||
|
||||
- name: Verifica presenza directory mirror
|
||||
@ -31,7 +31,7 @@
|
||||
- name: Collegamento directory mirror
|
||||
file: path=/var/lib/nethserver/ibay/ks/mirror src=/var/spool/apt-mirror/mirror state=link
|
||||
become: yes
|
||||
when: chk_mirror_dir|success
|
||||
when: chk_mirror_dir is succeeded
|
||||
|
||||
- name: Creazione directory preseed
|
||||
file:
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
- name: Configuring TFTP
|
||||
shell: /sbin/e-smith/db configuration setprop dnsmasq tftp-status enabled dhcp-boot pxelinux.0
|
||||
when: chk_tftp_enabled|changed
|
||||
when: chk_tftp_enabled is changed
|
||||
|
||||
- name: Activating tftp
|
||||
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
|
||||
when: chk_tftp_enabled|changed
|
||||
when: chk_tftp_enabled is changed
|
||||
|
@ -23,7 +23,7 @@
|
||||
name: python-argparse
|
||||
state: present
|
||||
become: yes
|
||||
when: check_argparse|changed
|
||||
when: check_argparse is changed
|
||||
tags: ansible
|
||||
|
||||
#- name: Download della gestione client con ansible
|
||||
|
@ -9,7 +9,7 @@
|
||||
- name: Installo epel-release
|
||||
yum: name=epel-release state=present
|
||||
become: yes
|
||||
when: check_epel|failed
|
||||
when: check_epel is failed
|
||||
register: epel_installed
|
||||
ignore_errors: yes
|
||||
|
||||
@ -18,20 +18,20 @@
|
||||
name: "http://dl.fedoraproject.org/pub/epel/6/{{ ansible_architecture }}/epel-release-6-8.noarch.rpm"
|
||||
state: present
|
||||
become: yes
|
||||
when: epel_installed|failed
|
||||
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|changed or epel_installed|success or rpm_epel_installed|changed
|
||||
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|changed
|
||||
when: epel_enabled is changed
|
||||
tags: repo
|
||||
|
||||
- name: Aggiorno il sistema
|
||||
|
@ -15,4 +15,4 @@
|
||||
|
||||
- name: Locking nethserver-release version
|
||||
shell: yum versionlock add nethserver-release
|
||||
when: chk_locked_nethrelease|changed
|
||||
when: chk_locked_nethrelease is changed
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
- name: Creazione directory .ssh
|
||||
shell: mkdir -p $HOME/.ssh
|
||||
when: check_sshdir|failed
|
||||
when: check_sshdir is 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|failed
|
||||
when: check_key is failed
|
||||
|
@ -23,14 +23,14 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
when: chk_mount_nfs|changed
|
||||
when: chk_mount_nfs is 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|changed
|
||||
when: chk_mount_nfs is changed
|
||||
|
||||
- name: Mounting share
|
||||
shell: mount /var/spool/apt-mirror/mirror
|
||||
when: chk_mount_nfs|changed
|
||||
when: chk_mount_nfs is changed
|
||||
|
Loading…
x
Reference in New Issue
Block a user