From 6b6c2034be1b520a1e73de079b337c104280bb2d Mon Sep 17 00:00:00 2001 From: amreo Date: Thu, 11 May 2017 08:58:34 +0200 Subject: [PATCH 1/4] Added possibility to change wan0 ip mode --- domain.yml | 4 ++++ roles/nethcfg/tasks/network.yml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/domain.yml b/domain.yml index c92dac3..99a72f8 100644 --- a/domain.yml +++ b/domain.yml @@ -7,6 +7,10 @@ servernetmask: 255.255.255.0 servernet: 172.16.254.0 servergw: 172.16.254.1 serverfqdn: pdc.topolin.ia +wan0mode: dhcp +wan0ip: dhcp +wan0netmask: dhcp +wan0gateway: dhcp domainshort: TOPOLIN domainfull: topolin.ia dhcprange_start: 172.16.254.10 diff --git a/roles/nethcfg/tasks/network.yml b/roles/nethcfg/tasks/network.yml index e8ffb29..cf2b097 100644 --- a/roles/nethcfg/tasks/network.yml +++ b/roles/nethcfg/tasks/network.yml @@ -1,8 +1,13 @@ --- # Reconfiguring network interfaces -- name: Configuring external NIC +- name: Configuring external NIC (dhcp) shell: /sbin/e-smith/db networks setprop {{ extnic }} role red bootproto dhcp + when: ansible_local.domain.wan0mode == dhcp + +- name: Configuring external NIC (static) + shell: /sbin/e-smith/db networks setprop {{ extnic }} role red bootproto none ipaddr {{ ansible_local.domain.wan0ip}} netmask {{ ansible_local.domain.wan0netmask }} gateway {{ ansible_local.domain.wan0gateway }} + when: ansible_local.domain.wan0mode == static - name: Configuring internal NIC shell: /sbin/e-smith/db networks setprop {{ intnic }} role green ipaddr {{ ansible_local.domain.serverip }} netmask {{ ansible_local.domain.servernetmask }} From 80c2634519d7eaa267eeeebfde94d752d5490d8b Mon Sep 17 00:00:00 2001 From: amreo Date: Thu, 11 May 2017 10:37:58 +0200 Subject: [PATCH 2/4] Added possibility to change the client admin account (bglug) --- domain.yml | 3 +++ roles/preseed/templates/preseed/aula-trusty.seed | 6 +++--- roles/preseed/templates/preseed/client-trusty.seed | 6 +++--- roles/preseed/templates/preseed/docenti-trusty.seed | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/domain.yml b/domain.yml index 99a72f8..594651c 100644 --- a/domain.yml +++ b/domain.yml @@ -33,3 +33,6 @@ mirror_host: it.archive.ubuntu.com #mirror_security_path: /ubuntu client_gitbranch: master #client_gitrepo: "https://github.com/bglug-it/client-pull-installation.git" +client_admin_username: bglug +client_admin_fullname: BGLUG User +client_admin_crypted_password: $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./ diff --git a/roles/preseed/templates/preseed/aula-trusty.seed b/roles/preseed/templates/preseed/aula-trusty.seed index a8a2d0a..c6e7588 100644 --- a/roles/preseed/templates/preseed/aula-trusty.seed +++ b/roles/preseed/templates/preseed/aula-trusty.seed @@ -64,9 +64,9 @@ d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }} # User creation -d-i passwd/user-fullname string BgLUG User -d-i passwd/username string bglug -d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./ +d-i passwd/user-fullname string {{ ansible_local.domain.client_admin_fullname }} +d-i passwd/username string {{ ansible_local.domain.client_admin_username }} +d-i passwd/user-password-crypted password {{ ansible_local.domain.client_admin_crypted_password }} # Partitioning d-i partman-auto/init_automatically_partition select biggest_free diff --git a/roles/preseed/templates/preseed/client-trusty.seed b/roles/preseed/templates/preseed/client-trusty.seed index e6341b9..54a0240 100644 --- a/roles/preseed/templates/preseed/client-trusty.seed +++ b/roles/preseed/templates/preseed/client-trusty.seed @@ -64,9 +64,9 @@ d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }} # User creation -d-i passwd/user-fullname string BgLUG User -d-i passwd/username string bglug -d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./ +d-i passwd/user-fullname string {{ ansible_local.domain.client_admin_fullname }} +d-i passwd/username string {{ ansible_local.domain.client_admin_username }} +d-i passwd/user-password-crypted password {{ ansible_local.domain.client_admin_crypted_password }} # Partitioning d-i partman-auto/init_automatically_partition select biggest_free diff --git a/roles/preseed/templates/preseed/docenti-trusty.seed b/roles/preseed/templates/preseed/docenti-trusty.seed index 37f0967..e5c7af6 100644 --- a/roles/preseed/templates/preseed/docenti-trusty.seed +++ b/roles/preseed/templates/preseed/docenti-trusty.seed @@ -64,9 +64,9 @@ d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string {{ ansible_local.domain.ntpserver }} # User creation -d-i passwd/user-fullname string BgLUG User -d-i passwd/username string bglug -d-i passwd/user-password-crypted password $6$S8u22loyR$RJZUtmnqmadvas13BxjPkBjdcF1o6P0xGtweZ9MkUCKIbyzmzQFxvwPTwoX1AaPgRyNmvdevyUgs/AMRGH8O./ +d-i passwd/user-fullname string {{ ansible_local.domain.client_admin_fullname }} +d-i passwd/username string {{ ansible_local.domain.client_admin_username }} +d-i passwd/user-password-crypted password {{ ansible_local.domain.client_admin_crypted_password }} # Partitioning d-i partman-auto/init_automatically_partition select biggest_free From 6ce22a783eb6aa35d1eeb1e6bc55d44eeba405f3 Mon Sep 17 00:00:00 2001 From: amreo Date: Mon, 15 May 2017 15:04:40 +0200 Subject: [PATCH 3/4] Fixed a syntax error --- roles/nethcfg/tasks/network.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/nethcfg/tasks/network.yml b/roles/nethcfg/tasks/network.yml index cf2b097..fa9dc97 100644 --- a/roles/nethcfg/tasks/network.yml +++ b/roles/nethcfg/tasks/network.yml @@ -3,11 +3,11 @@ - name: Configuring external NIC (dhcp) shell: /sbin/e-smith/db networks setprop {{ extnic }} role red bootproto dhcp - when: ansible_local.domain.wan0mode == dhcp + when: ansible_local.domain.wan0mode == "dhcp" - name: Configuring external NIC (static) shell: /sbin/e-smith/db networks setprop {{ extnic }} role red bootproto none ipaddr {{ ansible_local.domain.wan0ip}} netmask {{ ansible_local.domain.wan0netmask }} gateway {{ ansible_local.domain.wan0gateway }} - when: ansible_local.domain.wan0mode == static + when: ansible_local.domain.wan0mode == "static" - name: Configuring internal NIC shell: /sbin/e-smith/db networks setprop {{ intnic }} role green ipaddr {{ ansible_local.domain.serverip }} netmask {{ ansible_local.domain.servernetmask }} From 06415d4c9c1fbeff4204b15a6733d1aaaf6edb29 Mon Sep 17 00:00:00 2001 From: amreo Date: Sun, 28 May 2017 13:42:09 +0200 Subject: [PATCH 4/4] Updated the istruction how to change the password --- how_to_change_passwords.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/how_to_change_passwords.md b/how_to_change_passwords.md index 2a4190d..d73da4e 100644 --- a/how_to_change_passwords.md +++ b/how_to_change_passwords.md @@ -34,16 +34,11 @@ Open up the file `roles/init/tasks/mgmtuser.yml`, find out `password:` and then ## *bglug* user (client side but preseeded) ## -The definition of password for *bglug* is inside `*.seed` files, inside [`server-config`][1]. Create a new password hash with: +Create a new password hash with: $ mkpasswd -m sha-512 -Copy the hash in your clipboard; clone the repository, then in the working directory: - - $ find . -iname \*.seed -exec $EDITOR {} \; - -Within each `*.seed` file, search for the string `user-password-crypted` string and change following hash. - +Copy the hash after the colon of the option client_admin_crypted_password in `domain.yml`. ## *admin* user (domain valid) ## Password must be specified within NethServer interface for the *admin* user and must be absolutely equal to the one contained inside vault file.