* Updated anvil.conf to default-enable various defaults. Also dropped the archive thresholds.

* Fixed a bug in the PXE default config path to install.img.
* Added tftp to the BCN firewall template.
* Fixed a bug in anvil-daemon / striker-manage-install-target where config files weren't being updated regularly (only when repo updates happened).
* Removed an RPM from striker-manage-install-target that is no longer available on F28.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 6 years ago
parent 459fcfbcb3
commit 2fa4048780
  1. 32
      anvil.conf
  2. 9
      html/skins/alteeve/firewall.txt
  3. 10
      html/skins/alteeve/pxe.txt
  4. 7
      tools/anvil-daemon
  5. 3
      tools/anvil-manage-firewall
  6. 31
      tools/striker-manage-install-target

@ -64,16 +64,16 @@
#
# NOTE: If the archive directory doesn't exist, Anvil! will create it
# automatically the first time it is needed.
#sys::database::archive::compress = 1
#sys::database::archive::count = 50000
#sys::database::archive::directory = /usr/local/anvil/archives/
#sys::database::archive::division = 60000
#sys::database::archive::trigger = 100000
sys::database::archive::compress = 1
sys::database::archive::count = 10000
sys::database::archive::directory = /usr/local/anvil/archives/
sys::database::archive::division = 25000
sys::database::archive::trigger = 20000
# This puts a limit on how many queries (writes, generally) to make in a single batch transaction. This is
# useful when doing very large transacions, like resync'ing a large table, by limiting how long a given
# transaction can take and how much memory is used.
#sys::database::maximum_batch_size = 25000
sys::database::maximum_batch_size = 25000
### Apache stuff
@ -89,49 +89,49 @@
# This controls the default language. The value is the ISO code of the country's language you want to use by
# default. Note that the logging language is set with 'defaults::log::language' below.
# NOTE: Be sure the language exists before changing it!
#defaults::languages::output = en_CA
defaults::languages::output = en_CA
# This controls how many loops Anvil::Tools::Words is allow to make while processing a string. This acts as a
# mechanism to exit infinite loops, and generally should not need to be changed.
#defaults::limits::string_loops = 1000
defaults::limits::string_loops = 1000
### Logging options
# This controls whether all database transactions are recorded or not. Genreally this should be left off
# unless you are debugging the program.
# WARNING: This ignores 'secure', and will always be logged. Be careful about exposing sensitive data!
#sys::database::log_transactions = 1
sys::database::log_transactions = 0
# By default, if a configured database is not accessible, a log level 1 alert is registered. This can cause a
# lot of log traffic. If you want to silence these log alerts, you can set the value below to be higher than
# your current active log level (default is '1', so set to '2' or '3' to silence).
# NOTE: It's important to only use this temporarily.
#sys::database::failed_connection_log_level = 1
sys::database::failed_connection_log_level = 1
# This controls what log facility to use by default.
# NOTE: This will always be 'authpriv' when a log entry is marked as secure.
#defaults::log::facility = local0
defaults::log::facility = local0
# This controls what language logs are recorded in. Be sure that the language exists before changing it!
#defaults::log::language = en_CA
defaults::log::language = en_CA
# This controls the default log level. See 'perldoc Anvil::Tools::Logs' for details.
#defaults::log::level = 1
defaults::log::level = 1
# This controls whether sensitive log entries are logged or not. Generally, this should be left disabled!
#defaults::log::secure = 0,
defaults::log::secure = 0
# THis sets the default log server to send the log entries to. Leave it blank in most cases.
#defaults::log::server =
# This sets the default log tag used when logging an entry. Most programs will likely override this.
#defaults::log::tag = anvil
defaults::log::tag = anvil
### Templates
# This sets the default template used when rendering HTML pages. It must be the same as the directory name
# under /var/www/html/skins/
#defaults::template::html = alteeve
defaults::template::html = alteeve
### Install Target options

@ -6,10 +6,11 @@
<zone>
<short>#!variable!zone!#</short>
<description>#!variable!description!#</description>
<service name="ssh"/>
<service name="postgresql"/>
<service name="http"/>
<service name="https"/>
<service name="postgresql"/>
<service name="ssh"/>
<service name="tftp"/>
</zone>
<!-- end bcn_zone -->
@ -18,10 +19,10 @@
<zone>
<short>#!variable!zone!#</short>
<description>#!variable!description!#</description>
<service name="ssh"/>
<service name="postgresql"/>
<service name="http"/>
<service name="https"/>
<service name="postgresql"/>
<service name="ssh"/>
</zone>
<!-- end ifn_zone -->

@ -680,7 +680,7 @@ TEXT HELP
ENDTEXT
kernel fedora28/vmlinuz
# NOTE: add ' rd.debug' below for debugging
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/striker.ks inst.gpt inst.sshd
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/striker.ks inst.gpt inst.sshd
label node
menu label #!string!message_0086!#
@ -688,7 +688,7 @@ TEXT HELP
#!string!message_0087!#
ENDTEXT
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/node.ks inst.gpt inst.sshd
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/node.ks inst.gpt inst.sshd
label node
menu label #!string!message_0088!#
@ -696,7 +696,7 @@ TEXT HELP
#!string!message_0089!#
ENDTEXT
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/dr.ks inst.gpt inst.sshd
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/images/install.img inst.stage2=#!variable!base_url!#/os/ ip=dhcp inst.ks=#!variable!base_url!#/kickstart/dr.ks inst.gpt inst.sshd
label rescue
menu label #!string!message_0090!#
@ -704,7 +704,7 @@ TEXT HELP
#!string!message_0091!#
ENDTEXT
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img ip=dhcp root=live:#!variable!base_url!#/os/LiveOS/squashfs.img rescue inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.sshd
append initrd=fedora28/initrd.img ip=dhcp root=live:#!variable!base_url!#/LiveOS/squashfs.img rescue inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.sshd
label fedora
menu label #!string!message_0092!#
@ -712,7 +712,7 @@ TEXT HELP
#!string!message_0093!#
ENDTEXT
kernel fedora28/vmlinuz
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/os/images/install.img inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.gpt inst.sshd
append initrd=fedora28/initrd.img root=live:#!variable!base_url!#/images/install.img inst.repo=#!variable!base_url!#/os/ ip=dhcp inst.gpt inst.sshd
label next
menu default

@ -180,6 +180,9 @@ sub handle_periodic_tasks
# Check the firewall needs to be updated.
check_firewall($anvil);
# Check to see if the PXE environment needs to be updated.
check_install_target($anvil);
# Check if the files on disk have changed. Even if it is time to check, don't if a job is
# running.
if ((not $anvil->data->{timing}{jobs_running}) && ($anvil->Storage->check_md5sums))
@ -245,10 +248,8 @@ sub check_install_target
return(0);
}
my $shell_call = $anvil->data->{path}{exe}{'striker-manage-install-target'}." --status";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});
my $status = "unavailable";
my $output = $anvil->System->call({shell_call => $shell_call, source => $THIS_FILE, line => __LINE__});
my $output = $anvil->System->call({shell_call => $anvil->data->{path}{exe}{'striker-manage-install-target'}." --status --check --no-refresh"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { output => $output }});
foreach my $line (split/\n/, $output)
{

@ -22,7 +22,6 @@
# firewall-cmd --zone=IFN1 --remove-masquerade
#
use strict;
use warnings;
use Anvil::Tools;
@ -40,7 +39,7 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$running_directory =~ s/^\./$ENV{PWD}/;
}
my $anvil = Anvil::Tools->new({log_level => 2, log_secure => 1});
my $anvil = Anvil::Tools->new({log_level => 1, log_secure => 1});
$anvil->Storage->read_config({file => $anvil->data->{path}{configs}{'anvil.conf'}});

@ -52,10 +52,11 @@ $anvil->Storage->read_config({file => $anvil->data->{path}{configs}{'anvil.conf'
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches
$anvil->data->{switches}{'y'} = "";
$anvil->data->{switches}{check} = 0;
$anvil->data->{switches}{force} = "";
$anvil->data->{switches}{'job-uuid'} = "";
$anvil->data->{switches}{refresh} = 0;
$anvil->data->{switches}{force} = "";
$anvil->data->{switches}{'y'} = "";
$anvil->Get->switches();
# Make sure we're running as 'root'
@ -63,37 +64,43 @@ $anvil->Get->switches();
if (($< != 0) && ($> != 0))
{
# Not root
print $anvil->Words->string({key => "error_0005"})."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "error_0005"});
$anvil->nice_exit({code => 5});
}
# If the user just wants a status, check and exit.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "switches::status" => $anvil->data->{switches}{status} }});
if ($anvil->data->{switches}{status})
{
my $dhcpd_running = $anvil->System->check_daemon({daemon => $anvil->data->{sys}{daemon}{dhcpd}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { dhcpd_running => $dhcpd_running }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { dhcpd_running => $dhcpd_running }});
if ($dhcpd_running)
{
print $anvil->Words->string({key => "message_0123"})."\n";
print "status=1\n";
if (not $anvil->data->{switches}{check})
{
$anvil->nice_exit({code => 0});
}
}
else
{
print $anvil->Words->string({key => "message_0124"})."\n";
print "status=0\n";
if (not $anvil->data->{switches}{check})
{
$anvil->nice_exit({code => 0});
}
}
}
# Connect to the database(s).
$anvil->Database->connect;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"});
if (not $anvil->data->{sys}{database}{connections})
{
# No databases, exit.
print $anvil->Words->string({key => "error_0003"})."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, secure => 0, key => "error_0003"});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "error_0003"});
$anvil->nice_exit({exit_code => 8});
}
update_progress($anvil, 1, "clear");
@ -141,7 +148,7 @@ if ($anvil->data->{switches}{disable})
# Exit if we're not configured yet
my $configured = $anvil->System->check_if_configured;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { configured => $configured }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configured => $configured }});
if (not $configured)
{
print $anvil->Words->string({key => "error_0046"})."\n";
@ -257,6 +264,13 @@ sub check_refresh
{
my ($anvil) = @_;
# If '--no-refresh' is passed, don't refresh
if ($anvil->data->{switches}{'no-refresh'})
{
return(0);
update_progress($anvil, 90, "");
}
# Setup the packages directory
$anvil->data->{path}{directories}{packages} = "/var/www/html/".$anvil->data->{host_os}{os_type}."/".$anvil->data->{host_os}{os_arch}."/os/Packages";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "path::directories::packages" => $anvil->data->{path}{directories}{packages} }});
@ -1905,7 +1919,6 @@ sub load_packages
"libXaw.x86_64",
"libxcb.x86_64",
"libXcomposite.x86_64",
"libxcrypt-common.noarch",
"libxcrypt-devel.x86_64",
"libxcrypt.x86_64",
"libXcursor.x86_64",

Loading…
Cancel
Save