Comment 3 for bug 1281377

Revision history for this message
Erik Lönroth (sssler-scania) wrote :

This below is what I have to add to the model cloudinit-user data to get juju to run on centos.

1. Adding in repos for this needed by juju + centos (Because centos doesn't have late enough python3 by default)
2. Adding python3 + libs to even run basic juju stuff.
3. Manually configure proxy for yum (Because juju doesn't know how)
4. Modify ubuntu user in flight (To enable me to use NFS for homes)
5. Install and enable snap (because centos doesn't start and enable services after install which Ubuntu does)
6. Install and enable ssh (because centos doesn't start and enable services after install which Ubuntu does)
7. Manually configure snapd (since juju doesn't know how on centos even though there are model configs for it)

cloudinit-userdata: |
  yum_repos:
    epel-release:
      baseurl: http://download.fedoraproject.org/pub/epel/7/$basearch
      enabled: true
      failovermethod: priority
      gpgcheck: true
      gpgkey: http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
      name: Extra Packages for Enterprise Linux 7 - Release
  preruncmd:
    - mkdir -p /lhome
    - usermod ubuntu -m -d /lhome/ubuntu
    - sed -i 's+\(^HOME\|^# HOME\)=/home$+HOME=/lhome+g' /etc/default/useradd
    - echo "proxy=http://my.proxy.com:8080" >> /etc/yum.conf
    - yum --setopt=ip_resolve=4 --setopt=proxy=http://my.proxy.com:8080 -y install epel-release redhat-lsb-core sudo openssh-server python36-virtualenv python36-PyYAML python3 snapd python3-pip
  postruncmd:
    - usermod -p '*' ubuntu
    - systemctl start sshd
    - systemctl enable sshd
    - systemctl start snapd
    - systemctl enable snapd
    - snap set system proxy.https="http://my.proxy.com:8080"
    - snap set system proxy.http="http://my.proxy.com:8080"