Skip to content

Commit

Permalink
update profile and vsi to use cloud-init to install nfs
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Oct 10, 2023
1 parent c6d185e commit 3d3db26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
28 changes: 2 additions & 26 deletions modules/1_vpc_prepare/templates/cloud-init.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@

#cloud-config
packages:
- bind
- bind-utils
- httpd
- mod_ssl
- nfs-utils
- squid
write_files:
- path: /tmp/named-conf-edit.sed
permissions: '0640'
content: |
/^\s*listen-on port 53 /s/127\.0\.0\.1/127\.0\.0\.1; MYIP/
/^\s*allow-query /s/localhost/any/
/^\s*dnssec-validation /s/ yes/ no/
/^\s*type hint;/s/ hint/ forward/
/^\s*file\s"named.ca";/d
/^\s*type forward/a \\tforward only;\n\tforwarders { 161.26.0.7; 161.26.0.8; };
- path: /etc/exports
permissions: '0640'
content: |
/export *(rw)
- path: /etc/squid/squid.conf
permissions: '0640'
content: |
acl localnet src 10.0.0.0/8
acl localnet src 172.16.0.0/12
acl localnet src 192.168.0.0/16
http_access deny !localnet
http_port 3128
coredump_dir /var/spool/squid
runcmd:
- export MYIP=`hostname -I`; sed -i.bak "s/MYIP/$MYIP/" /tmp/named-conf-edit.sed
- sed -i.orig -f /tmp/named-conf-edit.sed /etc/named.conf
- systemctl enable named.service nfs-server squid
- systemctl start named.service nfs-server squid
- systemctl enable nfs-server
- systemctl start nfs-server
- mkdir -p /export && chmod -R 777 /export
3 changes: 2 additions & 1 deletion modules/1_vpc_prepare/vsi.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ resource "ibm_is_instance" "supp_vm_vsi" {
zone = var.vpc_zone
keys = [locals.key_id]
image = data.ibm_is_image.supp_vm_image[0].id
profile = "cx2-2x4"
profile = "cx2d-8x16"
# Profiles: https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui
# Originally used cx2-2x4, however 8x16 includes 300G storage.

resource_group = data.ibm_is_vpc.vpc.resource_group

Expand Down

0 comments on commit 3d3db26

Please sign in to comment.