Guest User

Untitled

a guest
Oct 19th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. ## error
  2. [root@salt create_vpc]# salt '*' state.apply
  3. salt.localdomain:
  4. ----------
  5. ID: Create subnet
  6. Function: boto_vpc.subnet_present
  7. Name: dlab-new-subnet
  8. Result: True
  9. Comment: Subnet dlab-new-subnet created.
  10. Started: 15:52:12.366904
  11. Duration: 1002.984 ms
  12. Changes:
  13. ----------
  14. new:
  15. ----------
  16. subnet:
  17. ----------
  18. availability_zone:
  19. us-east-1e
  20. cidr_block:
  21. 10.64.58.0/24
  22. id:
  23. subnet-f2bc79ce
  24. tags:
  25. ----------
  26. Name:
  27. dlab-new-subnet
  28. vpc_id:
  29. vpc-fbf8fa9c
  30. old:
  31. ----------
  32. subnet:
  33. None
  34. ----------
  35. ID: Create internet gateway
  36. Function: boto_vpc.internet_gateway_present
  37. Name: dlab-new-igw
  38. Result: True
  39. Comment: Internet gateway dlab-new-igw created.
  40. Started: 15:52:13.370038
  41. Duration: 422.893 ms
  42. Changes:
  43. ----------
  44. new:
  45. ----------
  46. internet_gateway:
  47. igw-2efa2c49
  48. old:
  49. ----------
  50. internet_gateway:
  51. None
  52. ----------
  53. ID: Create route
  54. Function: boto_vpc.route_table_present
  55. Name: my_route_table
  56. Result: False
  57. Comment: Failed to create route table: Bad Request: The routeTable ID 'rtb-39147c5f' does not exist.
  58. Started: 15:52:13.793132
  59. Duration: 446.112 ms
  60. Changes:
  61.  
  62. Summary for salt.localdomain
  63. ------------
  64. Succeeded: 2 (changed=2)
  65. Failed: 1
  66. ------------
  67. Total states run: 3
  68. Total run time: 1.872 s
  69. rhel_test3:
  70. Minion did not return. [No response]
  71.  
  72.  
  73. ## latest code
  74. [root@salt create_vpc]# cat init.sls
  75. {% set custom_vpc_name = 'dlab-new' %}
  76. {% set custom_keyid = 'AKIAJUJEVURNZT5IFXNQ' %}
  77. {% set custom_key = 'JGEZcNhoU9ob/gxIVrZ9XNQFoZEYAdfgpEkQeY7A' %}
  78. {% set custom_region = 'us-east-1' %}
  79. {% set cidr_block = '10.64.58.0/24' %}
  80. {% set instance_id = 'ami-6d1c2007' %}
  81.  
  82. # Create a vpc using the execution module
  83. {% set create_vpc = salt.boto_vpc.create(vpc_name=custom_vpc_name,cidr_block=cidr_block,enable_dns_hostnames=True,region=custom_region,keyid=custom_keyid,key=custom_key) %}
  84. # Get vpc_id of the previously created vpc using the execution module
  85. {% set vpc_id = salt.boto_vpc.get_id(name=custom_vpc_name, region=custom_region, keyid=custom_keyid, key=custom_key)['id'] %}
  86.  
  87. Create subnet:
  88. boto_vpc.subnet_present:
  89. - name: {{ custom_vpc_name }}-subnet
  90. - vpc_id: {{ vpc_id }}
  91. - cidr_block: {{ cidr_block }}
  92. - region: {{ custom_region }}
  93. - keyid: {{ custom_keyid }}
  94. - key: {{ custom_key }}
  95.  
  96. Create internet gateway:
  97. boto_vpc.internet_gateway_present:
  98. - name: {{ custom_vpc_name }}-igw
  99. - vpc_id: {{ vpc_id }} # I have changed this line from vpc_name into vpc_id, is that what you meant ?
  100. - keyid: {{ custom_keyid }}
  101. - key: {{ custom_key }}
  102.  
  103. Create route:
  104. boto_vpc.route_table_present:
  105. - name: my_route_table
  106. - vpc_id: {{ vpc_id }}
  107. - subnet_names:
  108. - {{ custom_vpc_name }}-subnet
  109. - region: {{ custom_region }}
  110. - profile:
  111. keyid: {{ custom_keyid }}
  112. key: {{ custom_key }}
Advertisement
Add Comment
Please, Sign In to add comment