github.com/deemoprobe/k8s-first-commit@v0.0.0-20230430165612-a541f1982be3/src/templates/salt-minion.sh (about)

     1  # Copyright 2014 Google Inc. All rights reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  # The repositories are really slow and there are GCE mirrors
    16  sed -i -e "\|^deb.*http://http.debian.net/debian| s/^/#/" /etc/apt/sources.list
    17  sed -i -e "\|^deb.*http://ftp.debian.org/debian| s/^/#/" /etc/apt/sources.list.d/backports.list
    18  
    19  # Prepopulate the name of the Master
    20  mkdir -p /etc/salt/minion.d
    21  echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf
    22  
    23  # Turn on debugging for salt-minion
    24  # echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion
    25  
    26  # Our minions will have a pool role to distinguish them from the master.
    27  cat <<EOF >/etc/salt/minion.d/grains.conf
    28  grains:
    29    roles:
    30      - kubernetes-pool
    31    cbr-cidr: $MINION_IP_RANGE
    32  EOF
    33  
    34  # Install Salt
    35  #
    36  # We specify -X to avoid a race condition that can cause minion failure to
    37  # install.  See https://github.com/saltstack/salt-bootstrap/issues/270
    38  curl -L http://bootstrap.saltstack.org | sh -s -- -X