Installing and running PCMS

Introduction

PCMS is a configuration management systems (CMS) based on GNU Make. It is still in development.

Prologue

  1. Log in as root on tty1.

Can’t copy and paste from here into the terminal?

Depending whether you are installing a physical machine, virtual machine or a container, you may or may not be able to copy content from here and paste it directly into the console.

  1. You may wish to continue over ssh by running:
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
    systemctl restart ssh
    ip addr    #  note the IP address into which to ssh

    but beware that, later, pcms must be run from the console (because it can change the system’s IP address).

Installing a released version of PCMS

  1. Download the svn-cache-passwd script as follows:
    apt -y install wget
    cd /tmp
    wget https://svn.pasta.freemyip.com/main/smalltools/trunk/bin/svn-cache-passwd
    chmod 755 svn-cache-passwd

    (More details about this script and the procedure to install and use it can be found here.)

  2. Insert the password for the Subversion repository hosting the PCMS module into the plain-text password store by running:
    /tmp/svn-cache-passwd https://svn.pasta.freemyip.com/private/
    
  3. Run:
    cd /tmp
    wget https://repo.pasta.freemyip.com/debian/pool/ade_2.0.9-1_all.deb
    wget https://repo.pasta.freemyip.com/debian/pool/pcms_2.0.20-1_all.deb
    dpkg -i --force-depends *.deb
    apt -y --fix-broken install
    
  4. Download the site-specific PCMS configuration module by running:
    mkdir -p /etc/pcms
    svn co -q https://svn.pasta.freemyip.com/private/pcms-config/trunk \
        /etc/pcms/pcms-config
    ln -s pcms-config /etc/pcms/site-config
    

    and following the prompts (if any).

Installing the development version of PCMS

  1. Set up a minimal ~/.vimrc containing:
    :syntax on
    :set paste
    :set background=dark
    :set noi
  2. Download the svn-cache-passwd script as follows:
    apt-get -y install wget
    cd /tmp
    wget https://svn.pasta.freemyip.com/main/smalltools/trunk/bin/svn-cache-passwd
    chmod 755 svn-cache-passwd

    (More details about this script and the procedure to install and use it can be found here.)

  3. Insert the password for the Subversion repository hosting the PCMS module into the plain-text password store by running:
    /tmp/svn-cache-passwd https://svn.pasta.freemyip.com/main/
    /tmp/svn-cache-passwd https://svn.pasta.freemyip.com/private/
    
  4. Run:
    #  install ADE and ADE's prerequisites
    wget https://repo.pasta.freemyip.com/debian/pool/ade_2.0.9-1_all.deb
    dpkg -i --force-depends *.deb
    apt-get -y --fix-broken install
    
    #  install PCMS's prerequisites
    apt-get -y install subversion debfoster vim apt-transport-https network-manager libeatmydata1 gnupg bridge-utils
    
    #  install PCMS from source
    mkdir -p /usr/local/opt
    cd /usr/local/opt
    svn co -q https://svn.pasta.freemyip.com/main/pcms/trunk pcms
    make -C pcms
    
    #  use the example pcms.conf file as the real pcms.conf file
    mkdir -p /etc/pcms
    cp pcms/doc/examples/pcms.conf /etc/pcms/
  5. Download the site-specific PCMS configuration module by running:
    mkdir -p /etc/pcms
    svn co -q https://svn.pasta.freemyip.com/private/pcms-config/trunk \
        /etc/pcms/pcms-config
    ln -s pcms-config /etc/pcms/site-config
    

    and following the prompts (if any).

  6. Run the PCMS development shell:
    /usr/local/opt/pcms/bin/pcmsdevsh

Adding a new host to the site-specific PCMS configuration module

  1. Edit /etc/pcms/site-config/hosts/gen-facility-local and add the host.

Running PCMS

  1. Verify that PCMS can find all its components by running:
    pcms -h > /dev/null

    Any output is an error in PCMS or this documentation.

  2. Run PCMS as follows:
    pcms --no-update-os -- -n > /dev/null
    
  3. If the previous command failed then modify the site-specific PCMS configuration module and rerun this test command.
  4. Make sure you are logged in on the console (optional instructions above mean you may have connected by ssh).
  5. Then run it for real as follows:
    pcms -v
  6. Remember to commit your edits to the site-specific PCMS configuration module!

See also