On 29 May 2019, at 23:04, Boudjoudad Abdelkader <boujoudad@gmail.com> wrote:I was using curtin but now i'm using cloud-init post-installatio, after the installation freeipa-client is installed and sssd.conf configured as well as krb5.conf and krb5.keytab but the nfs mount doesn't work !The command to deploy the script is:maas $PROFILE machine deploy $SYSTEM_ID user_data=$(base64 -w 0 /opt/myscript.sh)The script is executed after the installation i can see that but it seems to have a problem with ipa-client-installation !On Wed, May 29, 2019 at 4:59 PM John Keates <john@keates.nl> wrote:In what phase do you run the script? It should be one of the last scripts in the final phase for the install to work reliably. If it’s in preconfig or config phase it breaks 9 out of 10 times.John
On 29 May 2019, at 22:53, Boudjoudad Abdelkader <boujoudad@gmail.com> wrote:I'm using cloud-init with this script:
locale-gen en_CA.utf8
locale-gen en_US.utf8
HOSTNAME=$(hostname)
IP=$(hostname -i | awk '{print $1}')
echo "$HOSTNAME.example.com" > /etc/hostname
FQDN="$HOSTNAME.example.com"
echo "FQDN is: $FQDN"
sed -i "1 i\
$IP $FQDN $HOSTNAME" /etc/hosts
apt-get -y update
apt-get install -y nfs-kernel-server nfs-common
DEBIAN_FRONTEND=noninteractive apt-get -y install freeipa-client
ipa-client-install --hostname=$(hostname -f) --server=freeipa.example.com --domain example.com --no-ntp --unattended --principal admin --password 'Deep201' --realm EXAMPLE.COM --enable-dns-updates --force --force-joinsed -i '/ticket_lifetime/a renew_lifetime = 28d' /etc/krb5.confI will test with only --enable-dns-updates, principal and passwordThe network is configured well because i can reach the nfs server.On Wed, May 29, 2019 at 4:44 PM John Keates <john@keates.nl> wrote:What I meant was that you are already practically disabling it; you specify the hostname, domain, server, realm on your command line but those should be discoverable.Here is an enrollment jinja2 template I use:ipa-client-install -U --enable-dns-updates --principal={{freeipa.client.enroll.username}} --password={{freeipa.client.enroll.password}}It’s all that’s needed as long as your network has the correct setup. You’d replace the principal and password with your own of course.It would probably look like:ipa-client-install -U --enable-dns-updates —principal=admin --password=Deep201qaJohnOn 29 May 2019, at 22:39, Boudjoudad Abdelkader <boujoudad@gmail.com> wrote:Hi John,Thank you for the quick reply,To disable autodiscrovery the option is ?--autodiscovery=noOn Wed, May 29, 2019 at 4:18 PM John Keates <john@keates.nl> wrote:I don’t know what you are missing, but I do know that in theory your enrolment should work with just -U for unattended and the principal and password.Unless you have a special environment that requires auto discovery to be disabled, I’d recommend using it.I’m enrolling clients in three ways that all work this way, one using a Cloud-Init module, one using a SaltStack formula and one using a Lambda function that uses SSH to connect to a machine and run the enrolment remotely.The text from your mount command seems to suggest a timeout issue, perhaps the network isn’t up or DNS is broken? I’m also seeing you using an IP, it’s usually a sign of an incomplete or improper network setup (but technically it should be fine)John
On 29 May 2019, at 22:10, Boudjoudad Abdelkader via FreeIPA-users <freeipa-users@lists.fedorahosted.org> wrote:_______________________________________________Hello,I'm trying to automate freeipa-client installation on Ubuntu with custom script using MAAS as follow :
HOSTNAME=$(hostname)
IP=$(hostname -i | awk '{print $1}')
echo "$HOSTNAME.example.com" > /etc/hostname
FQDN="$HOSTNAME.example.com"
echo "FQDN is: $FQDN"
sed -i "1 i\
$IP $FQDN $HOSTNAME" /etc/hosts
apt-get -y update
apt-get install -y nfs-kernel-server nfs-common
DEBIAN_FRONTEND=noninteractive apt-get -y install freeipa-client
ipa-client-install --hostname=$(hostname -f) --server=freeipa.example.com --domain example.com --no-ntp --unattended --principal admin --password 'Deep201qa' --realm EXAMPLE.COM --enable-dns-updates
sed -i '/ticket_lifetime/a renew_lifetime = 28d' /etc/krb5.confservice sssd restartAfter the deployment i can do kinit domain_user and ipa user-show without any problem, but when i tried to mount an nfs in /ec/fstab with the following options i get an error:
The mount in /etc/fstab: nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=krb5,local_lock=none 0 0The error:
mount -av
/ : ignored
none : ignored
mount.nfs4: timeout set for Wed May 29 20:04:29 2019
mount.nfs4: trying text-based options 'vers=4.2,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=krb5,local_lock=none,addr=172.16.2.11,clientaddr=IP_ADDR0ESSI tried to install freeipa-client manually and the nfs mount works:ipa-client-installWhat i'm missing?Thanks,
FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org
To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org