diff --git a/domain.yml b/domain.yml index c92dac3..594651c 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 @@ -29,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/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. diff --git a/roles/nethcfg/tasks/network.yml b/roles/nethcfg/tasks/network.yml index e8ffb29..fa9dc97 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 }} 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