NAME
App::CharmKit::Sys
SYNOPSIS
use charm;
or
use App::CharmKit::Sys;
apt_update();
apt_upgrade();
apt_install(['nginx-common', 'redis-server']);
DESCRIPTION
Provides system utilities such as installing packages, managing files, and more.
- spew
-
writes to a file, defaults to utf8
- slurp
-
reads a file, defaults to utf8
- make_dir
-
mkdir helper for creating directories
- remove_dir
-
removes directories
- set_owner
-
sets owner of directories
set_owner('ubuntu', ['/var/lib/mydb', '/etc/mydb/conf'])
- getent
-
accesses user info from nss
Params
- add_user
-
adds user to system
Params
- del_user
-
removes a user, does attempt to remove home directory
- execute
-
Executes a local command:
my $cmd = ['juju-log', 'a message']; my $ret = execute($cmd); print $ret->{stdout};
Params
- apt_add_repo
-
Adds a archive repository or ppa. key is required if adding http source.
source can be in the format of:
ppa:charmers/example deb https://stub:key@private.example.com/ubuntu trusty main
- apt_install
-
Installs packages via apt-get
apt_install(['nginx']);
- apt_upgrade
-
Upgrades system
apt_upgrade();
- apt_update
-
Update repository sources
apt_update();
- service_control
-
Controls a upstart service
- service_status
-
Get running status of service
- load_helper($opts)
-
Helper for bringing in additional utilities. A lot of utilities are exported automatically however, this is useful if more control is required over the helpers.
Params
*
opts
Options to pass into helper class - read_ini
-
Basic config parsing for ini like files like whats found in most of /etc/default. This will also automatically return its root property.
Params
1;