Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
Update fedora offering
Browse files Browse the repository at this point in the history
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
  • Loading branch information
Ganesh Maharaj Mahalingam committed Mar 17, 2021
1 parent 15e5e55 commit 928e12f
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
63 changes: 63 additions & 0 deletions workloads/fedora32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
base_image_url: https://mirror.lax.genesisadaptive.com/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2
base_image_name: Fedora 32
vm:
disk_gib: 16
...
---
#cloud-config
write_files:
{{- if len $.HTTPProxy }}
- content: |
[Service]
Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},{{.Hostname}}{{end}}"
path: /etc/systemd/system/docker.service.d/http-proxy.conf
{{- end}}
{{with proxyEnv . 5}}
- content: |
{{.}}
path: /etc/environment
{{end -}}

dnf:
{{- if len $.HTTPProxy }}
proxy: "{{$.HTTPProxy}}"
{{- end}}
{{- if len $.HTTPSProxy }}
https_proxy: "{{$.HTTPSProxy}}"
{{- end}}

package_upgrade: {{with .PackageUpgrade}}{{.}}{{else}}false{{end}}

runcmd:
- {{beginTask . "Booting VM"}}
- {{endTaskOk . }}

- hostnamectl set-hostname {{.Hostname}}

- {{beginTask . (printf "Adding %s to /etc/hosts" .Hostname) }}
- echo "127.0.0.1 {{.Hostname}}" >> /etc/hosts
- {{endTaskCheck .}}

{{range .Mounts}}
- mkdir -p {{.Path}}
- sudo chown {{$.User}}:{{$.User}} {{.Tag}}
- echo "{{.Tag}} {{.Path}} 9p x-systemd.automount,x-systemd.device-timeout=10,nofail,trans=virtio,version=9p2000.L 0 0" >> /etc/fstab
{{end}}
{{range .Mounts}}
- {{beginTask $ (printf "Mounting %s" .Path) }}
- mount {{.Path}}
- {{endTaskCheck $}}
{{end}}

users:
- name: {{.User}}
uid: "{{.UID}}"
gid: "{{.GID}}"
gecos: CC Demo User
lock-passwd: true
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
ssh-authorized-keys:
- {{.PublicKey}}
...
63 changes: 63 additions & 0 deletions workloads/fedora33.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
base_image_url: https://mirror.lax.genesisadaptive.com/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2
base_image_name: Fedora 33
vm:
disk_gib: 16
...
---
#cloud-config
write_files:
{{- if len $.HTTPProxy }}
- content: |
[Service]
Environment="HTTP_PROXY={{$.HTTPProxy}}"{{if len .HTTPSProxy}} "HTTPS_PROXY={{.HTTPSProxy}}{{end}}"{{if len .NoProxy}} "NO_PROXY={{.NoProxy}},{{.Hostname}}{{end}}"
path: /etc/systemd/system/docker.service.d/http-proxy.conf
{{- end}}
{{with proxyEnv . 5}}
- content: |
{{.}}
path: /etc/environment
{{end -}}

dnf:
{{- if len $.HTTPProxy }}
proxy: "{{$.HTTPProxy}}"
{{- end}}
{{- if len $.HTTPSProxy }}
https_proxy: "{{$.HTTPSProxy}}"
{{- end}}

package_upgrade: {{with .PackageUpgrade}}{{.}}{{else}}false{{end}}

runcmd:
- {{beginTask . "Booting VM"}}
- {{endTaskOk . }}

- hostnamectl set-hostname {{.Hostname}}

- {{beginTask . (printf "Adding %s to /etc/hosts" .Hostname) }}
- echo "127.0.0.1 {{.Hostname}}" >> /etc/hosts
- {{endTaskCheck .}}

{{range .Mounts}}
- mkdir -p {{.Path}}
- sudo chown {{$.User}}:{{$.User}} {{.Tag}}
- echo "{{.Tag}} {{.Path}} 9p x-systemd.automount,x-systemd.device-timeout=10,nofail,trans=virtio,version=9p2000.L 0 0" >> /etc/fstab
{{end}}
{{range .Mounts}}
- {{beginTask $ (printf "Mounting %s" .Path) }}
- mount {{.Path}}
- {{endTaskCheck $}}
{{end}}

users:
- name: {{.User}}
uid: "{{.UID}}"
gid: "{{.GID}}"
gecos: CC Demo User
lock-passwd: true
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
ssh-authorized-keys:
- {{.PublicKey}}
...

0 comments on commit 928e12f

Please sign in to comment.