(FunctionDef ensure-local-disks [] (List (If (Subshell (Com {[LIT_CHARS grep]} {[DQ [LIT_CHARS /mnt/ephemeral]]} {[LIT_CHARS /proc/mounts]} ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Found /mnt/ephemeral in /proc/mounts; skipping local disk initialization"]]} ) (Com {[LIT_CHARS return]} ) ) ) (= scope= flags=0 words=[] bindings=[('block_devices', {[Array ]})]) (= scope= flags=0 words=[] bindings=[('ephemeral_devices', {[ComSub (AndOr OP_OR_IF (Subshell (Pipeline (Com {[LIT_CHARS curl]} {[LIT_CHARS --silent]} {[LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //169.254.169.254/2014-11-05/meta-data/block-device-mapping/]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS ephemeral]}) ) ) (Com {[LIT_CHARS true]}) )]})]) (For ephemeral_device [{[VarSub ephemeral_devices]}]) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Checking ephemeral device: "][VarSub ephemeral_device]]} ) (= scope= flags=0 words=[] bindings=[('aws_device', {[ComSub (Com {[LIT_CHARS curl]} {[LIT_CHARS --silent]} {[LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //169.254.169.254/2014-11-05/meta-data/block-device-mapping/] [VarSub ephemeral_device]})]})]) (= scope= flags=0 words=[] bindings=[('device_path', {[DQ ]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -b]} {[LIT_CHARS /dev/] [VarSub aws_device]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[] bindings=[('device_path', {[DQ [LIT_CHARS /dev/][VarSub aws_device]]})]) (ElseTrue) (List (= scope= flags=0 words=[] bindings=[('xvd_style', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[VarSub aws_device]}) (Com {[LIT_CHARS sed]} {[DQ [LIT_CHARS s/sd/xvd/]]}) )]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -b]} {[LIT_CHARS /dev/] [VarSub xvd_style]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[] bindings=[('device_path', {[DQ [LIT_CHARS /dev/][VarSub xvd_style]]})]) ) ) ) (If (DBracket {B1 UNARY_STRING_z {[VarSub device_path]}}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " Could not find disk: "][VarSub ephemeral_device][LIT_CHARS "@"][VarSub aws_device]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS " Detected ephemeral disk: "][VarSub ephemeral_device][LIT_CHARS "@"][VarSub device_path]]} ) (= scope= flags=0 words=[] bindings=[('block_devices+', {[Array {[VarSub device_path]}]})]) ) ) ) ) (= scope= flags=0 words=[] bindings=[('move_docker', {[DQ ]})]) (= scope= flags=0 words=[] bindings=[('move_kubelet', {[DQ ]})]) (= scope= flags=0 words=[] bindings=[('docker_storage', {[VarSub DOCKER_STORAGE test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS aufs]}]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]} {[LIT_CHARS 0]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "No ephemeral block devices found; will use aufs on root"]]} ) (= scope= flags=0 words=[] bindings=[('docker_storage', {[DQ [LIT_CHARS aufs]]})]) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Block devices: "][VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]} ) (For block_device [{[VarSub block_devices]}]) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Unmounting "][VarSub block_device]]} ) (AndOr OP_OR_IF (Com {[LIT_CHARS /bin/umount]} {[VarSub block_device]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Ignoring failure umounting "][VarSub block_device]]} ) ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -i]} {[LIT_CHARS -e]} {[DQ [\ LIT_ESCAPED_CHAR "\\|"][LIT_CHARS "^"][VarSub block_device][LIT_CHARS "|d"]]} {[LIT_CHARS /etc/fstab]} ) ) ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -i]} {[LIT_CHARS -e]} {[DQ [\ LIT_ESCAPED_CHAR "\\|"][LIT_CHARS "/mnt/ephemeral|d"]]} {[LIT_CHARS /etc/fstab]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS btrfs]]}}) (List (Com {[LIT_CHARS apt-get-install]} {[LIT_CHARS btrfs-tools]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]} {[LIT_CHARS 1]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "One ephemeral block device found; formatting with btrfs"]]} ) (Com {[LIT_CHARS mkfs.btrfs]} {[LIT_CHARS -f]} {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}})]} ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Found multiple ephemeral block devices, formatting with btrfs as RAID-0"]]} ) (Com {[LIT_CHARS mkfs.btrfs]} {[LIT_CHARS -f]} {[LIT_CHARS --data]} {[LIT_CHARS raid0]} {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}})][LIT_CHARS " /mnt/ephemeral btrfs noatime,nofail 0 0"]]} < (FilenameRedirectNode filename={[LIT_CHARS /etc/fstab]} >"> 1), > ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS mount]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral/kubernetes]} ) (= scope= flags=0 words=[] bindings=[('move_docker', {[DQ [LIT_CHARS /mnt/ephemeral]]})]) (= scope= flags=0 words=[] bindings=[('move_kubelet', {[DQ [LIT_CHARS /mnt/ephemeral/kubernetes]]})]) ) (DBracket {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS aufs-nolvm]]}}) (List (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[(#len)]]} {[LIT_CHARS 1]}}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "aufs-nolvm selected, but multiple ephemeral devices were found; only the first will be available"]]} ) ) (Com {[LIT_CHARS mkfs]} {[LIT_CHARS -t]} {[LIT_CHARS ext4]} {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}})]} ) (Com {[LIT_CHARS echo]} {[DQ [VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}})][LIT_CHARS " /mnt/ephemeral ext4 noatime,nofail 0 0"]]} < (FilenameRedirectNode filename={[LIT_CHARS /etc/fstab]} >"> 1), > ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS mount]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral/kubernetes]} ) (= scope= flags=0 words=[] bindings=[('move_docker', {[DQ [LIT_CHARS /mnt/ephemeral]]})]) (= scope= flags=0 words=[] bindings=[('move_kubelet', {[DQ [LIT_CHARS /mnt/ephemeral/kubernetes]]})]) ) (DBracket {B? LOGICAL_BINARY_OR {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS devicemapper]]}} {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS aufs]]}}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Using LVM2 and ext4"]]} ) (Com {[LIT_CHARS apt-get-install]} {[LIT_CHARS lvm2]} ) (= scope= flags=1 words=[] bindings=[('LVM_SUPPRESS_FD_WARNINGS', {[LIT_CHARS 1]})]) (For block_device [{[VarSub block_devices]}]) (Com {[LIT_CHARS pvcreate]} {[VarSub block_device]} ) ) (Com {[LIT_CHARS vgcreate]} {[LIT_CHARS vg-ephemeral]} {[VarSub block_devices bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS devicemapper]]}}) (List (Com {[LIT_CHARS lvcreate]} {[LIT_CHARS -l]} {[LIT_CHARS 80] [LIT_OTHER "%"] [LIT_CHARS VG]} {[LIT_CHARS --thinpool]} {[LIT_CHARS docker-thinpool]} {[LIT_CHARS vg-ephemeral]} ) (= scope= flags=0 words=[] bindings=[('DOCKER_OPTS', {[DQ [VarSub DOCKER_OPTS test_op=VS_TEST_COLON_HYPHEN {}][LIT_CHARS " --storage-opt dm.thinpooldev=/dev/mapper/vg--ephemeral-docker--thinpool"]]})]) (Com {[LIT_CHARS lvcreate]} {[LIT_CHARS -l]} {[LIT_CHARS 100] [LIT_OTHER "%"] [LIT_CHARS FREE]} {[LIT_CHARS -n]} {[LIT_CHARS kubernetes]} {[LIT_CHARS vg-ephemeral]} ) (Com {[LIT_CHARS mkfs]} {[LIT_CHARS -t]} {[LIT_CHARS ext4]} {[LIT_CHARS /dev/vg-ephemeral/kubernetes]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral/kubernetes]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "/dev/vg-ephemeral/kubernetes /mnt/ephemeral/kubernetes ext4 noatime,nofail 0 0"]]} < (FilenameRedirectNode filename={[LIT_CHARS /etc/fstab]} >"> 1), > ) (Com {[LIT_CHARS mount]} {[LIT_CHARS /mnt/ephemeral/kubernetes]} ) (= scope= flags=0 words=[] bindings=[('move_kubelet', {[DQ [LIT_CHARS /mnt/ephemeral/kubernetes]]})]) ) (ElseTrue) (List (Com {[LIT_CHARS lvcreate]} {[LIT_CHARS -l]} {[LIT_CHARS 100] [LIT_OTHER "%"] [LIT_CHARS VG]} {[LIT_CHARS -n]} {[LIT_CHARS ephemeral]} {[LIT_CHARS vg-ephemeral]} ) (Com {[LIT_CHARS mkfs]} {[LIT_CHARS -t]} {[LIT_CHARS ext4]} {[LIT_CHARS /dev/vg-ephemeral/ephemeral]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "/dev/vg-ephemeral/ephemeral /mnt/ephemeral ext4 noatime,nofail 0 0"]]} < (FilenameRedirectNode filename={[LIT_CHARS /etc/fstab]} >"> 1), > ) (Com {[LIT_CHARS mount]} {[LIT_CHARS /mnt/ephemeral]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS /mnt/ephemeral/kubernetes]} ) (= scope= flags=0 words=[] bindings=[('move_docker', {[DQ [LIT_CHARS /mnt/ephemeral]]})]) (= scope= flags=0 words=[] bindings=[('move_kubelet', {[DQ [LIT_CHARS /mnt/ephemeral/kubernetes]]})]) ) ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Ignoring unknown DOCKER_STORAGE: "][VarSub docker_storage]]} ) ) ) ) (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS btrfs]]}}) (= scope= flags=0 words=[] bindings=[('DOCKER_OPTS', {[DQ [VarSub DOCKER_OPTS test_op=VS_TEST_COLON_HYPHEN {}][LIT_CHARS " -s btrfs"]]})]) (DBracket {B? LOGICAL_BINARY_OR {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS aufs-nolvm]]}} {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS aufs]]}}}) (List (If (DBracket {B2 BINARY_STRING_EQUAL {[ComSub (Com {[LIT_CHARS lsb_release]} {[LIT_CHARS -i]} {[LIT_CHARS -s]})]} {[SQ ]}}) (Com {[LIT_CHARS apt-get-install]} {[LIT_CHARS linux-image-extra-] [ComSub (Com {[LIT_CHARS uname]} {[LIT_CHARS -r]})]} {[LIT_CHARS linux-image-extra-virtual]} ) ) (Com {[LIT_CHARS apt-get-install]} {[LIT_CHARS aufs-tools]} ) (= scope= flags=0 words=[] bindings=[('DOCKER_OPTS', {[DQ [VarSub DOCKER_OPTS test_op=VS_TEST_COLON_HYPHEN {}][LIT_CHARS " -s aufs"]]})]) ) (DBracket {B2 BINARY_STRING_EQUAL {[VarSub docker_storage]} {[DQ [LIT_CHARS devicemapper]]}}) (= scope= flags=0 words=[] bindings=[('DOCKER_OPTS', {[DQ [VarSub DOCKER_OPTS test_op=VS_TEST_COLON_HYPHEN {}][LIT_CHARS " -s devicemapper"]]})]) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Ignoring unknown DOCKER_STORAGE: "][VarSub docker_storage]]} ) ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub move_docker]]}}) (List (AndOr OP_OR_IF (Com {[LIT_CHARS systemctl]} {[LIT_CHARS stop]} {[LIT_CHARS docker]} ) (Com {[LIT_CHARS true]} ) ) (If (DBracket {B1 UNARY_FILE_d {[LIT_CHARS /var/lib/docker]}}) (Com {[LIT_CHARS mv]} {[LIT_CHARS /var/lib/docker]} {[VarSub move_docker] [LIT_CHARS /]} ) ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[VarSub move_docker] [LIT_CHARS /docker]} ) (If (DBracket {B! {B1 UNARY_FILE_e {[LIT_CHARS /var/lib/docker]}}}) (Com {[LIT_CHARS ln]} {[LIT_CHARS -s]} {[VarSub move_docker] [LIT_CHARS /docker]} {[LIT_CHARS /var/lib/docker]} ) ) (= scope= flags=0 words=[] bindings=[('DOCKER_ROOT', {[DQ [VarSub move_docker][LIT_CHARS /docker]]})]) (= scope= flags=0 words=[] bindings=[('DOCKER_OPTS', {[DQ [VarSub DOCKER_OPTS test_op=VS_TEST_COLON_HYPHEN {}][LIT_CHARS " -g "][VarSub DOCKER_ROOT]]})]) ) ) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub move_kubelet]]}}) (List (If (DBracket {B1 UNARY_FILE_d {[LIT_CHARS /var/lib/kubelet]}}) (Com {[LIT_CHARS mv]} {[LIT_CHARS /var/lib/kubelet]} {[VarSub move_kubelet] [LIT_CHARS /]} ) ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[VarSub move_kubelet] [LIT_CHARS /kubelet]} ) (If (DBracket {B! {B1 UNARY_FILE_e {[LIT_CHARS /var/lib/kubelet]}}}) (Com {[LIT_CHARS ln]} {[LIT_CHARS -s]} {[VarSub move_kubelet] [LIT_CHARS /kubelet]} {[LIT_CHARS /var/lib/kubelet]} ) ) (= scope= flags=0 words=[] bindings=[('KUBELET_ROOT', {[DQ [VarSub move_kubelet][LIT_CHARS /kubelet]]})]) ) ) ) )