2016-10-12 8 views
-1

テンプレートは、クラウド設定で設定したbambooユーザを生成しません。私はクラスタにsshを入れてcat/etc/passwdを見るが、そのユーザは見えない。何がうまくいかないでしょうか?CoreOSクラウド設定でユーザが作成されていません

 { 
 
      "AWSTemplateFormatVersion": "2010-09-09", 
 
      "Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", 
 
      "Mappings" : { 
 
       "RegionMap" : { 
 
    
 
        "us-west-2" : { 
 
         "AMI" : "ami-06af7f66" 
 
        } 
 
       } 
 
      }, 
 
      "Parameters": { 
 
      "InstanceType" : { 
 
       "Description" : "EC2 HVM instance type (m3.medium, etc).", 
 
       "Type" : "String", 
 
       "Default" : "t2.small", 
 
       "AllowedValues" : [ "t2.micro", "m3.medium", "i2.4xlarge", "i2.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge","r3.4xlarge", "r3.8xlarge", "t2.micro", "t2.small", "t2.medium" ], 
 
       "ConstraintDescription" : "Must be a valid EC2 HVM instance type." 
 
      }, 
 
      "myVPC": { 
 
       "Type": "AWS::EC2::VPC::Id", 
 
       "Description": "The VPC Id where the instances will be deployed into." 
 
      }, 
 
      "SecurityGroupId":{ 
 
       "Type": "List<AWS::EC2::SecurityGroup::Id>", 
 
       "Description": "Security group to launch instances into." 
 
      }, 
 
      "SubnetId":{ 
 
       "Type": "List<AWS::EC2::Subnet::Id>", 
 
       "Description": "VPC group to launch instances into." 
 
      }, 
 
      "ClusterSize": { 
 
       "Default": "3", 
 
       "MinValue": "3", 
 
       "MaxValue": "12", 
 
       "Description": "Number of nodes in cluster (3-12).", 
 
       "Type": "Number" 
 
      }, 
 
      "DiscoveryURL": { 
 
       "Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new?size=<your cluster size>", 
 
       "Type": "String" 
 
      }, 
 
      "AdvertisedIPAddress": { 
 
       "Description": "Use 'private' if your etcd cluster is within one region or 'public' if it spans regions or cloud providers.", 
 
       "Default": "private", 
 
       "AllowedValues": ["private", "public"], 
 
       "Type": "String" 
 
      }, 
 
      "KeyPair" : { 
 
       "Description" : "The name of an EC2 Key Pair to allow SSH access to the instance.", 
 
       "Type" : "AWS::EC2::KeyPair::KeyName" 
 
      } 
 
      }, 
 
      "Resources": { 
 
      "CoreOSServerAutoScale": { 
 
       "Type": "AWS::AutoScaling::AutoScalingGroup", 
 
       "Properties": { 
 
       "LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"}, 
 
       "VPCZoneIdentifier": {"Ref":"SubnetId"}, 
 
       "MinSize": "3", 
 
       "MaxSize": "12", 
 
       "DesiredCapacity": {"Ref": "ClusterSize"}, 
 
       "Tags": [ 
 
        {"Key": "Name", "Value": { "Ref" : "AWS::StackName" }, "PropagateAtLaunch": true} 
 
       ] 
 
       } 
 
      }, 
 
    
 
      "CoreOSServerLaunchConfig": { 
 
       "Type": "AWS::AutoScaling::LaunchConfiguration", 
 
       "Properties": { 
 
       "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, 
 
       "InstanceType": {"Ref": "InstanceType"}, 
 
       "KeyName": {"Ref": "KeyPair"}, 
 
       "SecurityGroups": {"Ref": "SecurityGroupId"}, 
 
       "UserData" : { "Fn::Base64": 
 
        { "Fn::Join": [ "", [ 
 
        "#cloud-config\n\n", 
 
        " users:\n", 
 
        " - name: bamboo\n", 
 
        "  groups:\n", 
 
        "  - sudo\n", 
 
        "  - docker\n", 
 
        "  - fleet\n", 
 
        "  - systemd\n", 
 
        "  - wheel\n", 
 
        "  - bamboo\n", 
 
        "  ssh-authorized-keys:\n", 
 
        "  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKT3QjGuTD4sdBfKZZm1cOz2gXBH546vGizsDGf3LEQC63QduU1CPQBvTG742H5yVix7y+qvZPTYlvQ1ysK6ezhbGeu+lT0WoI8YT4x2Pqe/F40WGn/SMv3ckELQhKH3gp9HC1z/ITxYVgTksKGGXgNO6G8w8J+XaC1hyYntyOz531GAly9szCxtPQJQCz1fS3fdjSPEM+7TyuwH240S/Aa0R0XGUt24xH4zyifmUjrvGq4AaHIFUyWO3XnEc/3kdA2uUQlV/2o7z9xE0WhYPWm2oReHXNuoOCQutTCYwNKaTI+Y/vGtGxsCmIQWVoY4Afg2nL0MQ1Mnfw3DddQJvB [email protected]_agent_fleetctl \n", 
 
        "coreos:\n", 
 
        " etcd2:\n", 
 
        " discovery: ", { "Ref": "DiscoveryURL" }, "\n", 
 
        " advertise-client-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2379\n", 
 
        " initial-advertise-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", 
 
        " listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001\n", 
 
        " listen-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", 
 
        " units:\n", 
 
        " - name: etcd2.service\n", 
 
        "  command: start\n", 
 
        " - name: fleet.service\n", 
 
        "  command: start\n" 
 
         ] ] 
 
        } 
 
       } 
 
       } 
 
      } 
 
      } 
 
     }

クラスタが生成され、うまく動作しますが、私は、そのユーザが表示されていないされています。ユーザー世代が発生しなかった理由をログで確認できる場所はありますか?

答えて

0

あなたはまた、online validatorたりCoreOSマシン上coreos-cloudinit -validateを実行してを使用して、クラウド-config設定を確認することができますjournalctl --identifier=coreos-cloudinit

を使用して、クラウドの設定で何が起こったかのログを見ることができ、あなたの実際の質問に答えます。

しかし、あなたの設定を見てみると、users blockがあふれていると思われます。

次のように動作するはずです:

#cloud-config 
users: 
    - name: bamboo 
    groups: 
     - sudo 
     - docker 
     - fleet 
     - systemd 
     - wheel 
     - bamboo 
    ssh-authorized-keys: 
     - ssh-rsa <RSA Public Key> [email protected]_agent_fleetctl 
coreos: 
    etcd2: 
    discovery: {Ref":DiscoveryURL" }, 
    advertise-client-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2379 
    initial-advertise-peer-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2380 
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001 
    listen-peer-urls: http://$ {Ref":AdvertisedIPAddress" },_ipv4:2380 
    units: 
    - name: etcd2.service 
     command: start 
    - name: fleet.service 
     command: start 
関連する問題