[foreman-users] Re: foreman_hooks: different json output on create and destroy

2017-06-01 Thread 'Konstantin Orekhov' via Foreman users


> But in 1.15.0 and even 1.14.3 it is like this:
>
> {
>   "host": {
> "host": {
>   "ip": "10.109.236.95",
>   "ip6": "",
>   "environment_id": 2,
>   "environment_name": "common",
>   "last_report": "2017-05-31 12:23:46 -0700",
>   "mac": "52:54:00:c7:da:da",
>   "realm_id": null,
>   "realm_name": null,
> 
>

I can't replicate this on 1.14.3 anymore, I think I may have mixed up my 
data and it appears that only 1.15.0 is affected.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Fresh Foreman 1.15.0 install dhcp subnet issue...

2017-06-01 Thread Sean A
Thanks for the reply, Lukas.  It's possible I ran the command above using 
the --foreman-proxy-dhcp-subnet='192.168.2.0/24', and it seems using the 
CIDR notation doesn't work.  I started fresh again, with the same installer 
args and reproduced it, then tried the installer again with 
--foreman-proxy-dhcp-subnet='192.168.2.0/255.255.255.0' and this seems to 
resolve the issue.

The interface error is blatantly obvious since it's defaults to eth0, even 
if no eth0 exists on the system.  Seems like some logic could be used to 
match the ipaddress fact to an interface and set that interface as the 
default for both dns and dhcp components...but I'm sure if it was that 
simple it would have been done already.

Anyway, I don't understand why using the CIDR notation would create a 
255.255.255.255 subnet for the host's IP.

On Thursday, June 1, 2017 at 10:03:43 AM UTC-4, Lukas Zapletal wrote:
>
> It works here, here is my command: 
>
> SATNET=122 
>   --foreman-proxy-dhcp true \ 
>   --foreman-proxy-dhcp-interface virbr1 \ 
>   --foreman-proxy-dhcp-gateway=192.168.${SATNET}.1 \ 
>   --foreman-proxy-dhcp-range="192.168.${SATNET}.10 192.168.${SATNET}.109" 
> \ 
>   --foreman-proxy-dhcp-nameservers="192.168.${SATNET}.1" \ 
>
> Make sure you provide foreman-proxy-dhcp-interface and it has correct 
> IP and mask. 
>
>
>
> On Wed, May 31, 2017 at 4:09 PM, Sean  
> wrote: 
> > Sorry, I should have mentioned that the Virtualbox Nat Network's gateway 
> is 
> > 192.168.2.1 and it has dhcp disabled.  Also, the foreman server's IP 
> address 
> > is 192.168.2.10. 
> > 
> > 
> > --Sean 
> > 
> > On Wed, May 31, 2017 at 10:02 AM, Sean A  > wrote: 
> >> 
> >> Hi, I've setup a prototype environment using Virtualbox with Nat 
> Network. 
> >> The Foreman VM is CentOS 7.3, I've installed foreman 1.15.0 with puppet 
> >> 4.10, so I can play with Hiera 5. 
> >> 
> >> Anyway, my installer command line is this: 
> >> 
> >> foreman-installer --foreman-proxy-dhcp=true 
> >> --foreman-proxy-dhcp-gateway='192.168.2.1' 
> --foreman-proxy-dhcp-managed=true 
> >> \ 
> >> --foreman-proxy-dhcp-nameservers='192.168.2.10' 
> >> --foreman-proxy-dhcp-option-domain='demo.local' \ 
> >> --foreman-proxy-dhcp-pxeserver='192.168.2.10' 
> >> --foreman-proxy-dhcp-range='192.168.2.20 192.168.2.50' \ 
> >> --foreman-proxy-dhcp-search-domains='demo.local' 
> >> --foreman-proxy-dhcp-server='192.168.2.10' --foreman-proxy-dns=true \ 
> >> --foreman-proxy-dns-forwarders=8.8.8.8 
> >> --foreman-proxy-dns-forwarders=8.8.4.4 --foreman-proxy-dns-managed=true 
> \ 
> >> --foreman-proxy-dns-reverse='2.168.192.in-addr.arpa' 
> >> --foreman-proxy-dns-server='192.168.2.10' \ 
> >> --foreman-proxy-dns-ttl='360' --foreman-proxy-dns-zone='demo.local' 
> >> --foreman-unattended=true --foreman-use-vhost=true \ 
> >> 
> --foreman-proxy-dhcp-provider='isc'--foreman-proxy-dns-provider='nsupdate' 
> >> --foreman-proxy-puppet=true \ 
> >> --foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true 
> >> --puppet-agent=true --puppet-autosign-entries='*.demo.local' \ 
> >> --puppet-server=true --puppet-server-ca=true --enable-foreman 
> >> --enable-foreman-proxy --enable-puppet 
> >> 
> >> The installer throws an error when trying to start the dhcpd service... 
> >> 
> >> May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address 
> >> 192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255 
> >> May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main 
> process 
> >> exited, code=exited, status=1/FAILURE 
> >> 
> >> Basically, the installer isn't defining the dhcp subnet correctly and 
> >> here's what the subnet in dhcpd.conf looks like: 
> >> 
> >> # demo.local 
> >> subnet 192.168.2.10 netmask 255.255.255.255 { 
> >>   pool 
> >>   { 
> >> range 192.168.2.20 192.168.2.50; 
> >>   } 
> >> 
> >> 
> >>   option subnet-mask 255.255.255.255; 
> >>   option routers 192.168.2.1; 
> >>   option domain-search "demo.local"; 
> >> } 
> >> 
> >> Any idea why the installer is defining the subnet as a single ip 
> address? 
> >> 
> >> -- 
> >> You received this message because you are subscribed to a topic in the 
> >> Google Groups "Foreman users" group. 
> >> To unsubscribe from this topic, visit 
> >> https://groups.google.com/d/topic/foreman-users/2G1mQWMo1u0/unsubscribe. 
>
> >> To unsubscribe from this group and all its topics, send an email to 
> >> foreman-user...@googlegroups.com . 
> >> To post to this group, send email to forema...@googlegroups.com 
> . 
> >> Visit this group at https://groups.google.com/group/foreman-users. 
> >> For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Foreman users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to foreman-user...@googlegroups.com . 
> > To post to this group, send email to 

[foreman-users] Foreman 1.12 and AWS

2017-06-01 Thread Isidor
Hello all,

I trying to test deploy instances in AWS from my foreman, i was following 
the next guide: 
https://theforeman.org/2016/02/ec2-provisioning-using-foreman-update.html
But when i launched the creation of the new host i had the error: " Failed 
to create a compute EC2 [...] The key pair 'foreman--xxx-xxx-xxx' does 
not exist ". 

So, my first idea was upload the key pair in foreman to AWS, i used the 
following group to obtain the key_pair: 
https://groups.google.com/forum/#!topic/foreman-users/4B95YBFbAR,  but in 
AWS i had to add the .pub, that i could not found it in foreman.  

The next step was create a key pair in aws and import in foreman , updating 
the field in the postgres database, but at the end i continue having the 
same problem :( .

What can i do ? or what can i check to find the error?

Thanks a lot for you help.

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Fresh Foreman 1.15.0 install dhcp subnet issue...

2017-06-01 Thread Lukas Zapletal
It works here, here is my command:

SATNET=122
  --foreman-proxy-dhcp true \
  --foreman-proxy-dhcp-interface virbr1 \
  --foreman-proxy-dhcp-gateway=192.168.${SATNET}.1 \
  --foreman-proxy-dhcp-range="192.168.${SATNET}.10 192.168.${SATNET}.109" \
  --foreman-proxy-dhcp-nameservers="192.168.${SATNET}.1" \

Make sure you provide foreman-proxy-dhcp-interface and it has correct
IP and mask.



On Wed, May 31, 2017 at 4:09 PM, Sean  wrote:
> Sorry, I should have mentioned that the Virtualbox Nat Network's gateway is
> 192.168.2.1 and it has dhcp disabled.  Also, the foreman server's IP address
> is 192.168.2.10.
>
>
> --Sean
>
> On Wed, May 31, 2017 at 10:02 AM, Sean A  wrote:
>>
>> Hi, I've setup a prototype environment using Virtualbox with Nat Network.
>> The Foreman VM is CentOS 7.3, I've installed foreman 1.15.0 with puppet
>> 4.10, so I can play with Hiera 5.
>>
>> Anyway, my installer command line is this:
>>
>> foreman-installer --foreman-proxy-dhcp=true
>> --foreman-proxy-dhcp-gateway='192.168.2.1' --foreman-proxy-dhcp-managed=true
>> \
>> --foreman-proxy-dhcp-nameservers='192.168.2.10'
>> --foreman-proxy-dhcp-option-domain='demo.local' \
>> --foreman-proxy-dhcp-pxeserver='192.168.2.10'
>> --foreman-proxy-dhcp-range='192.168.2.20 192.168.2.50' \
>> --foreman-proxy-dhcp-search-domains='demo.local'
>> --foreman-proxy-dhcp-server='192.168.2.10' --foreman-proxy-dns=true \
>> --foreman-proxy-dns-forwarders=8.8.8.8
>> --foreman-proxy-dns-forwarders=8.8.4.4 --foreman-proxy-dns-managed=true \
>> --foreman-proxy-dns-reverse='2.168.192.in-addr.arpa'
>> --foreman-proxy-dns-server='192.168.2.10' \
>> --foreman-proxy-dns-ttl='360' --foreman-proxy-dns-zone='demo.local'
>> --foreman-unattended=true --foreman-use-vhost=true \
>> --foreman-proxy-dhcp-provider='isc'--foreman-proxy-dns-provider='nsupdate'
>> --foreman-proxy-puppet=true \
>> --foreman-proxy-tftp=true --foreman-proxy-tftp-managed=true
>> --puppet-agent=true --puppet-autosign-entries='*.demo.local' \
>> --puppet-server=true --puppet-server-ca=true --enable-foreman
>> --enable-foreman-proxy --enable-puppet
>>
>> The installer throws an error when trying to start the dhcpd service...
>>
>> May 31 09:47:25 foreman.demo.local dhcpd[5726]: bad range, address
>> 192.168.2.20 not in subnet 192.168.2.10 netmask 255.255.255.255
>> May 31 09:47:25 foreman.demo.local systemd[1]: dhcpd.service: main process
>> exited, code=exited, status=1/FAILURE
>>
>> Basically, the installer isn't defining the dhcp subnet correctly and
>> here's what the subnet in dhcpd.conf looks like:
>>
>> # demo.local
>> subnet 192.168.2.10 netmask 255.255.255.255 {
>>   pool
>>   {
>> range 192.168.2.20 192.168.2.50;
>>   }
>>
>>
>>   option subnet-mask 255.255.255.255;
>>   option routers 192.168.2.1;
>>   option domain-search "demo.local";
>> }
>>
>> Any idea why the installer is defining the subnet as a single ip address?
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Foreman users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/foreman-users/2G1mQWMo1u0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> foreman-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to foreman-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/foreman-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-users+unsubscr...@googlegroups.com.
> To post to this group, send email to foreman-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.



-- 
Later,
  Lukas @lzap Zapletal

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] VM provisioning fails with errors

2017-06-01 Thread Lukas Zapletal
The DNS server on Foreman does not have foreman A record, add it manually
if this is what you want.

I'd love to have this in our installer, but we don't have it. With katello
plugin installed, you cannot workaround this with unattended_url anymore.

LZ

On Wed, May 31, 2017 at 8:57 PM, bijith nair  wrote:

> Hello Team,
>
> While trying to provisioning VM on VMware vcenter, The console show below
> error:-
>
>
> 
>
>
>
>
>
>
>
>
>
>
>
> To fix this up i have to manually change the hostname to ipaddr to make it
> working, Is there a way i can resolve the hostname?
>
> Note:
> #DNS Server is configured on foreman, Esxi and Media (ISO mounted) server
> and can resolve both hostname and ipaddr
> #/etc/hosts is updated
>
> Thanks in Advance..
>
> Rgds/Bijith
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-users+unsubscr...@googlegroups.com.
> To post to this group, send email to foreman-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Later,
  Lukas @lzap Zapletal

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] Re: Install loop after upgrade to 3.4

2017-06-01 Thread 'Denis Müller' via Foreman users
as a stupid workaround, after host was built, i'm shutting it down, set 
first boot device to hdd and cancel build in foreman.

Am Donnerstag, 1. Juni 2017 12:04:39 UTC+2 schrieb Nuno Marques:
>
> What I'm doing right now is: a few minutes after the host starts 
> installing I cancel the build. The host finishes the installation and 
> doesn't start another.
>
> On 01-06-2017 09:47, Denis Müller wrote:
>
> I have the same issue, no solutions yet...
>
> Am Mittwoch, 31. Mai 2017 11:09:56 UTC+2 schrieb Nuno Marques: 
>>
>> Hi all, 
>>
>> I've just upgraded katello 3.2 to 3.4. 
>> Now when I create a new Host on VMWare using a bootdisk, it enters a 
>> loop, when the host reboots the installation starts all over again. 
>>
>> Should I roll back the update or there's something I could fix? 
>>
>> Thanks! 
>>
>> -- 
>> nuno 
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] Re: Install loop after upgrade to 3.4

2017-06-01 Thread Nuno Marques
What I'm doing right now is: a few minutes after the host starts
installing I cancel the build. The host finishes the installation and
doesn't start another.

On 01-06-2017 09:47, Denis Müller wrote:
> I have the same issue, no solutions yet...
>
> Am Mittwoch, 31. Mai 2017 11:09:56 UTC+2 schrieb Nuno Marques:
>
> Hi all,
>
> I've just upgraded katello 3.2 to 3.4.
> Now when I create a new Host on VMWare using a bootdisk, it enters a
> loop, when the host reboots the installation starts all over again.
>
> Should I roll back the update or there's something I could fix?
>
> Thanks!
>
> -- 
> nuno
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] Import Puppet environments from command line

2017-06-01 Thread Peter Bittner
Hi there,

I've successfully managed to set up a Foreman host, a Puppet control 
repository and r10k on the Foreman host to pull changes from the repo 
whenever they are made (and merged into the main branch). Hence, Puppet 
environments are deployed automatically to the host. This is done by r10k, 
triggered by a webhook, and r10k also has a `postrun` hook configured that 
is supposed to tell Foreman that changes were just pulled and integrated.

What's still missing is to automatic updating / importing of Puppet 
environments in Foreman. Instead of going to *Configure* > *Environments* 
and klicking on the "Import environments from $hostname" button in the 
Foreman UI I want to have this happen automatically whenever changes are 
deployed by r10k -- that's what the `postrun` hook is good for.

The command I run in the hook is:

/usr/sbin/foreman-rake puppet:import:puppet_classes[batch]

According to the Foreman source code this task updates both all 
environments and classes. 
https://github.com/theforeman/foreman/blob/develop/lib/tasks/puppet.rake#L45-L46

Interestingly, despite some output on the console there is no change 
visible in The Foreman. The list of environments remains unchanged (one 
"production" entry only, just as originally installed). The output of the 
command is as follows:

$ sudo /usr/sbin/foreman-rake puppet:import:puppet_classes[batch]' 
Successfully encrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully encrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret

Any idea what's wrong? Why doesn't this command result in and update in The 
Foreman? Or is there a more suitable command?

Thanks for any hints,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] Re: [Event] Next Foreman Community Demo - Thu 01 Jun 3pm [GMT]

2017-06-01 Thread Greg Sutcliffe
Hi all,

Sadly this demo will have to be cancelled due to a combination of
circumstances - mainly lack of presenters, but also I can't be present
today to host it.

We'll see you in 3 weeks!

Greg

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.