Re: [foreman-users] Discovery plugin removes DHCP feature?

2017-10-11 Thread Lukas Zapletal
We have recently rewritten the DHCP conf parser and it looks like a
parser error. Please file a bug on smart-proxy component DHCP and if
possible include the configuration (dhcpd.conf and all included files
from there).

LZ

On Wed, Oct 11, 2017 at 4:53 PM, Charlie Baum  wrote:
> Proxy.log is showing this:
>
> Disabling all modules in the group ['dhcp'] due to a failure in one of them:
> (): did not find expected key while parsing a block mapping at line
> 4 column 1
>
>
> Not sure how to track that one down.
>
> On Wednesday, October 11, 2017 at 4:47:07 AM UTC-4, Lukas Zapletal wrote:
>>
>> No, something happened to DHCP module, check proxy.log and look into
>> initialization phase.
>>
>> Typically, when you perform upgrade of dhcp or tftp daemons (via
>> yum/apt), they will reset permissions on some files or directories
>> which will cause DHCP module to fail to init. This will fix it:
>>
>> setfacl -R -m u:foreman-proxy:rwx /etc/dhcp/ /var/lib/dhcpd/
>> /var/lib/tftpboot
>>
>> I think our develop branch installer will do this already so this
>> mis-behavior will disappear in 1.16+.
>>
>> LZ
>>
>> On Wed, Oct 11, 2017 at 3:19 AM, Charlie Baum  wrote:
>> > Running through a foreman POC and playing with discovery.  I went
>> > through
>> > the install/config docs for enabled discovery on the smart proxy.  When
>> > I
>> > refreshed the smart proxy, Discovery appeared but DHCP disappeared from
>> > the
>> > feature list.  Is this expected?
>> >
>> > --
>> > 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 forema...@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.



-- 
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] Foreman Discovery. Name of discovered hosts

2017-10-11 Thread Lukas Zapletal
https://www.theforeman.org/plugins/foreman_discovery/

It is all there. LZ

On Wed, Oct 11, 2017 at 6:40 PM, Conor Mc Garvey  wrote:
> Hey,
>
> I'm looking to change the name of the discovered host to something more
> recognisable.
>
> For the name I plan to combine the MAC with another fact (lldp port
> description).
>
> Where in the foreman discovery code does the discovered host name get sent
> to foreman?
>
> Thanks
>
> --
> 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] Foreman Discovery. Name of discovered hosts

2017-10-11 Thread Conor Mc Garvey
Hey,

I'm looking to change the name of the discovered host to something more 
recognisable.

For the name I plan to combine the MAC with another fact (lldp port 
description).

Where in the foreman discovery code does the discovered host name get sent 
to foreman?

Thanks

-- 
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] Discovery plugin removes DHCP feature?

2017-10-11 Thread Charlie Baum
Proxy.log is showing this:

Disabling all modules in the group ['dhcp'] due to a failure in one of 
them: (): did not find expected key while parsing a block mapping 
at line 4 column 1

Not sure how to track that one down.  

On Wednesday, October 11, 2017 at 4:47:07 AM UTC-4, Lukas Zapletal wrote:
>
> No, something happened to DHCP module, check proxy.log and look into 
> initialization phase. 
>
> Typically, when you perform upgrade of dhcp or tftp daemons (via 
> yum/apt), they will reset permissions on some files or directories 
> which will cause DHCP module to fail to init. This will fix it: 
>
> setfacl -R -m u:foreman-proxy:rwx /etc/dhcp/ /var/lib/dhcpd/ 
> /var/lib/tftpboot 
>
> I think our develop branch installer will do this already so this 
> mis-behavior will disappear in 1.16+. 
>
> LZ 
>
> On Wed, Oct 11, 2017 at 3:19 AM, Charlie Baum  > wrote: 
> > Running through a foreman POC and playing with discovery.  I went 
> through 
> > the install/config docs for enabled discovery on the smart proxy.  When 
> I 
> > refreshed the smart proxy, Discovery appeared but DHCP disappeared from 
> the 
> > feature list.  Is this expected? 
> > 
> > -- 
> > 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 forema...@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] Foreman 1.15.6 bug-fix release

2017-10-11 Thread Daniel Lobato Garcia
Foreman 1.15.6 is now available with bug fixes for nineteen issues.
Check out the release notes for the full list of changes:
https://theforeman.org/manuals/1.15/#Releasenotesfor1.15.6

This release is small and fixes:

* Problems with installing in EL 7.4
* DHCP leases no longer treated as conflicts
* docker-selinux and container-selinux policies don't conflict with
  Foreman's policy

Please report any bugs using our tracker (see the Bug reporting
section of this email).

Information
===
For installation or upgrade instructions, see:

Installation quick start:
https://theforeman.org/manuals/1.15/quickstart_guide.html

Upgrade instructions:
https://theforeman.org/manuals/1.15/index.html#3.6Upgrade

Release notes:
https://theforeman.org/manuals/1.15/index.html#Releasenotesfor1.15.6

Do take note of the upgrade warnings and deprecations in this release:
https://theforeman.org/manuals/1.15/index.html#Upgradewarnings


Downloads
=
Packages may be found in the 1.15 directories on both deb.foreman.org
and yum.theforeman.org, and tarballs are on downloads.theforeman.org.

The GPG key used for RPMs and tarballs has the following fingerprint:
6610 7FC8 658F F702 E849 9AC4 17A3 FD24 9A8D AAD5
(https://theforeman.org/security.html#GPGkeys)


Bug reporting
=
If you come across a bug, please file it and note the version of
Foreman
that you're using in the report.

Foreman: http://projects.theforeman.org/projects/foreman/issues/new
Proxy:
http://projects.theforeman.org/projects/smart-proxy/issues/new
Installer:
http://projects.theforeman.org/projects/puppet-foreman/issues/new



--
Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

-- 
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.


signature.asc
Description: PGP signature


Re: [foreman-users] Foreman bootdisk and external DHCP

2017-10-11 Thread Lukas Zapletal
Hello,

I have zero experience with Ubuntu/Debian preseed but you need to
identify exactly at which stage you loose IP connection. My bet would
be when the installer attempts to reconfigure network? Perhaps there
is some log on virtual console 2 or higher where you can see this.

FYI Preseed default finish (or any "finish" template kind) is only
used in cloud environment. In PXE it won't be used I think. At least
in Red Hat OS (there is post scriplet in kickstart for this).

Now, I can comment only on Red Hats since this is my primary OS. We
ship the default kickstart configured in a way that if the subnet
associated with the host is set to DHCP mode, it will configure the
primary device for DHCP. Otherwise, it will do static configuration. I
assume it's the same for Debians. For docs about kickstart you can go
to: http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#network
(or RHEL docs as well for enterprise versions).

Now it is important to understand that "network" kickstart option
re-configures network, but for PXE installations network needs to be
pre-initialized before Anaconda loads up. This is done by init ram
disk via kernel command line options. Again, by default we configure
DHCP or Static according to subnet setting. You can see this in
PXELinux template when doing PXE. For iPXE you can see this in iPXE
template ("Preseed default iPXE"). As you can see, iPXE IP address,
gateway and DNS is passed into the installer which will re-use these
to start Linux network stack.

So there are two phases, in your case the 2nd one perhaps fails. Check
your "Preseed default" template Preview option to see it.

Again, I suggest you to set things up without Foreman first to
understand how things work. I won't be able to help from screenshots,
I don't do Ubuntu provisioning much.



On Wed, Oct 11, 2017 at 1:13 PM, Craig Parker  wrote:
> Hi Lukas, and thanks so much for your reply.  I really appreciate the time 
> and effort you put into this.
>
> Unfortunately I've been really busy with operational tasks today and haven't 
> had any time to devote to this at all. What's happening though is this:
>
> - I boot the target machine (currently just an Ubuntu VM) with the generic 
> bootdisk option
> - The machine boots, gets an IP address off our existing DHCP infrastructure, 
> and contacts Foreman to look for a machine configured with its MAC
> - The machine finds a corresponding MAC address registered in Foreman, and 
> proceeds to build via the templates outlined at the GitHub bootdisk page:
> "Preseed default iPXE",
> "Preseed default", and
> "Preseed default finish"
>
> I haven't modified any of these templates at this stage while I try to 
> understand the process.
> At some stage fairly early on in the build though, it seems I lose my IP 
> address, and the build subsequently fails, as it can't download any required 
> files.  By this stage I can't find my VM on the network anymore either.
>
> I hope I've explained this ok. Does this make sense?
>
> Thanks for your comments regarding setting a DHCP option inside the preseed 
> or kickstart file.  I suspect that's all I may need to do perhaps. Sorry for 
> the possibly stupid question, but would you be able to give me any guidance 
> on how to set DHCP inside the preseed file (which one?) and / or inside the 
> RHEL kickstart file in Foreman?
>
> I should have a bit more time for this tomorrow and am more than happy to 
> provide screenshots / error messages / log files as necessary - I just don't 
> want to bomb you right now with potentially unnecessary extra stuff.
>
> Thanks again for your help, Craig
>
> --
> 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] Lots of "Mysql2::Error: Deadlock found when trying to get lock" under increased load

2017-10-11 Thread Lukas Zapletal
Oh now I understand, looks like a new bug. I am not able to reproduce
with FDI 3.4.1 and develop Foreman. The code responsible for finding
existing record is here:

https://github.com/theforeman/foreman_discovery/blob/develop/app/models/host/discovered.rb#L53-L62

Theoretically if you changed configuration of bootif fact in settings,
this could happen. But I assume you haven't. Was it also the same FDI
version, just in case facter changed facts?

If you visit the original discovery host in the UI, do you see
Interfaces list? What MAC address is there? Is it detected as the
primary interface there?

Do you still have both records in the DB? Can you run rake console and
try these statements? Or insert Rails.logger.info statements there to
see the code flow.

On Tue, Oct 10, 2017 at 8:01 PM, 'Konstantin Orekhov' via Foreman
users  wrote:
>
>>
>> Name has already been taken - this usually means that host (either
>> discovered or managed or unmanaged) of that name "macX" already
>> exist. Same mac address? You can change easily how discovered hosts are
>> being named, by default it is "mac" + MAC address, you can change that to
>> random number or any different fact you want. See settings and our
>> documentation. Try to add a random number at the end if that helps.
>
>
> Well, no, that's the same host. It was discovered at some point back (8 days
> ago as you can see in the screenshot above). Then it got rebooted/crashed,
> PXE-booted again and started sending its discovery payload again, but gets
> 422. Usually, if it is the same host, Foreman just updates existing entry
> with new facts, or at least, the time of last report. But in the case above,
> that did not happen as for some reason Foreman created another record in a
> DB (with a different ID) for the same host. Unless I remove both of the
> records, 422s will continue to happen. I was hoping that a gist I provided
> gives you enough info on what could have caused that double-record situation
> for the same host.
>
> Here are my DB entries for the above host:
>
> [root@spc03 ~]# mysql -u foreman -p$DB_PASS foreman -e "SELECT * from hosts
> where type = 'Host::Discovered' and NAME = 'mac90e2baea5d58'\G;"
> *** 1. row ***
>   id: 446735
> name: mac90e2baea5d58
> last_compile: NULL
>  last_report: 2017-10-02 05:49:35
>   updated_at: 2017-10-02 05:49:46
>   created_at: 2017-09-15 22:44:42
>root_pass: NULL
>  architecture_id: NULL
>   operatingsystem_id: NULL
>   environment_id: NULL
>ptable_id: NULL
>medium_id: NULL
>build: 0
>  comment: NULL
> disk: NULL
> installed_at: NULL
> model_id: 6
> hostgroup_id: NULL
> owner_id: 10
>   owner_type: User
>  enabled: 1
>   puppet_ca_proxy_id: NULL
>  managed: 0
>use_image: NULL
>   image_file: NULL
> uuid: NULL
>  compute_resource_id: NULL
>  puppet_proxy_id: NULL
> certname: NULL
> image_id: NULL
>  organization_id: NULL
>  location_id: NULL
> type: Host::Discovered
>  otp: NULL
> realm_id: NULL
>   compute_profile_id: NULL
> provision_method: NULL
>grub_pass:
>global_status: 0
> lookup_value_matcher: NULL
>discovery_rule_id: NULL
>salt_proxy_id: NULL
>  salt_environment_id: NULL
>   pxe_loader: NULL
> *** 2. row ***
>   id: 456978
> name: mac90e2baea5d58
> last_compile: NULL
>  last_report: 2017-10-10 16:04:20
>   updated_at: 2017-10-10 16:04:20
>   created_at: 2017-10-07 07:13:19
>root_pass: NULL
>  architecture_id: NULL
>   operatingsystem_id: NULL
>   environment_id: NULL
>ptable_id: NULL
>medium_id: NULL
>build: 0
>  comment: NULL
> disk: NULL
> installed_at: NULL
> model_id: NULL
> hostgroup_id: NULL
> owner_id: NULL
>   owner_type: NULL
>  enabled: 1
>   puppet_ca_proxy_id: NULL
>  managed: 0
>use_image: NULL
>   image_file: NULL
> uuid: NULL
>  compute_resource_id: NULL
>  puppet_proxy_id: NULL
> certname: NULL
> image_id: NULL
>  organization_id: NULL
>  location_id: NULL
> type: Host::Discovered
>  otp: NULL
> realm_id: NULL
>   compute_profile_id: NULL
> provision_method: NULL
>grub_pass:
>global_status: 0
> lookup_value_matcher: NULL
>discovery_rule_id: NULL
>salt_proxy_id: NULL
>  salt_environment_id: NULL
>

Re: [foreman-users] Foreman bootdisk and external DHCP

2017-10-11 Thread Craig Parker
Hi Lukas, and thanks so much for your reply.  I really appreciate the time and 
effort you put into this.

Unfortunately I've been really busy with operational tasks today and haven't 
had any time to devote to this at all. What's happening though is this:

- I boot the target machine (currently just an Ubuntu VM) with the generic 
bootdisk option
- The machine boots, gets an IP address off our existing DHCP infrastructure, 
and contacts Foreman to look for a machine configured with its MAC
- The machine finds a corresponding MAC address registered in Foreman, and 
proceeds to build via the templates outlined at the GitHub bootdisk page:
"Preseed default iPXE", 
"Preseed default", and 
"Preseed default finish"

I haven't modified any of these templates at this stage while I try to 
understand the process.
At some stage fairly early on in the build though, it seems I lose my IP 
address, and the build subsequently fails, as it can't download any required 
files.  By this stage I can't find my VM on the network anymore either. 

I hope I've explained this ok. Does this make sense?  

Thanks for your comments regarding setting a DHCP option inside the preseed or 
kickstart file.  I suspect that's all I may need to do perhaps. Sorry for the 
possibly stupid question, but would you be able to give me any guidance on how 
to set DHCP inside the preseed file (which one?) and / or inside the RHEL 
kickstart file in Foreman?  

I should have a bit more time for this tomorrow and am more than happy to 
provide screenshots / error messages / log files as necessary - I just don't 
want to bomb you right now with potentially unnecessary extra stuff.

Thanks again for your help, Craig 

-- 
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] FOSDEM / CfgMgmtCamp 2018 - Call for Presentations!

2017-10-11 Thread Greg Sutcliffe
Hi all,

It's that time of year again - the call for presentations for our
yearly conference season is now open!

FOSDEM - https://penta.fosdem.org/submission/FOSDEM18
CfgmgmtCamp - http://cfgmgmtcamp.eu/#cfp

This year is the 5th CfgMgmtCamp, and we want to make it the best yet.
So in addition to the usual developer updates, new plugins, and
community news talks, I'm very keen to hear from *users* - that's you!

Submit your success stories (or horror stories!), things you learned in
the trenches, or interesting ways you've put Foreman to use, and we'll
make sure that the users get a voice in this years Foreman track.

See you there!
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.


Re: [foreman-users] Discovery plugin removes DHCP feature?

2017-10-11 Thread Lukas Zapletal
No, something happened to DHCP module, check proxy.log and look into
initialization phase.

Typically, when you perform upgrade of dhcp or tftp daemons (via
yum/apt), they will reset permissions on some files or directories
which will cause DHCP module to fail to init. This will fix it:

setfacl -R -m u:foreman-proxy:rwx /etc/dhcp/ /var/lib/dhcpd/ /var/lib/tftpboot

I think our develop branch installer will do this already so this
mis-behavior will disappear in 1.16+.

LZ

On Wed, Oct 11, 2017 at 3:19 AM, Charlie Baum  wrote:
> Running through a foreman POC and playing with discovery.  I went through
> the install/config docs for enabled discovery on the smart proxy.  When I
> refreshed the smart proxy, Discovery appeared but DHCP disappeared from the
> feature list.  Is this expected?
>
> --
> 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.