marcoverl

IISAS-IM-test.radl

Sep 22nd, 2017
424
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. network private ( )
  2. network public ( outbound = 'yes' )
  3. contextualize (
  4. system front configure front step 1
  5. system wn configure wn step 2
  6. )
  7.  
  8. deploy front 1 occi
  9. deploy wn @input.NumNodes@ occi
  10.  
  11. system wn (
  12. disk.0.os.credentials.username = 'centos' and
  13. #instance_type = 'f0cd78ab-10a0-4350-a6cb-5f3fdd6e6294' and
  14. instance_type = '3' and
  15. net_interface.0.connection = 'private' and
  16. disk.0.os.name = 'linux' and
  17. #Image for CentOS 7
  18. #disk.0.image.url = 'ost://cloud-areapd.pd.infn.it/7544a870-90a6-4409-9a7d-5b376c278688'
  19. #Image for CentOS6
  20. disk.0.image.url = 'https://nova3.ui.savba.sk:8787/occi1.1/99a4ff5f-e0ad-4bb5-9d6a-54158176d331'
  21. )
  22.  
  23. system front (
  24. disk.0.os.credentials.username = 'centos' and
  25. queue_system = 'torque' and
  26. instance_type = '3' and
  27. net_interface.0.connection = 'public' and
  28. net_interface.1.connection = 'private' and
  29. net_interface.0.dns_name = 'test-ce.test.fedcloud.eu' and
  30. net_interface.1.dns_name = 'torques.localdomain' and
  31. disk.0.os.name = 'linux' and
  32. #Image for CentOS 7
  33. disk.0.image.url = 'https://nova3.ui.savba.sk:8787/occi1.1/01d4551e-d1ae-454a-b70d-319deec96eef'
  34.  
  35. )
  36.  
  37. configure add_users (
  38. @begin
  39.  
  40. - group: name=dteam
  41. - user: name=dteam001 group=dteam uid=18118 generate_ssh_key=yes shell=/bin/bash
  42. ignore_errors: true
  43. - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa.pub dest=/home/dteam001/.ssh/id_rsa.pub
  44. owner=dteam001 group=dteam mode=0644
  45. name: Copy the id_rsa.pub file to the user
  46. - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa.pub dest=/home/dteam001/.ssh/authorized_keys
  47. owner=dteam001 group=dteam mode=0644
  48. name: Copy the id_rsa.pub file to the user
  49. - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa dest=/home/dteam001/.ssh/id_rsa
  50. owner=dteam001 group=dteam mode=0600
  51. name: Copy the id_rsa file to the user
  52. - template: src=utils/templates/ssh_known_hosts.conf dest=/etc/ssh/ssh_known_hosts
  53.  
  54. @end
  55. )
  56.  
  57. configure wn (
  58. @begin
  59.  
  60. - tasks:
  61. - ignore_errors: true
  62. command: service iptables stop
  63. - include_vars: '{{item}}'
  64. with_first_found:
  65. - '{{ ansible_os_family }}.yml'
  66. - RedHat.yml
  67. - include: add_users.yml
  68. name: adding users...
  69. vars:
  70. NNODES: '@input.NumNodes@'
  71.  
  72. @end
  73. )
  74.  
  75. configure front (
  76. @begin
  77.  
  78. - tasks:
  79. - include_vars: '{{item}}'
  80. with_first_found:
  81. - '{{ ansible_os_family }}.yml'
  82. - RedHat.yml
  83. - command: hostname test-ce.test.fedcloud.eu
  84. - yum: name=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  85. - include: add_users.yml
  86. name: adding users...
  87. vars:
  88. NNODES: '@input.NumNodes@'
  89.  
  90. @end
  91. )
  92.  
  93. configure sudo_copy (
  94. @begin
  95.  
  96. - local_action: command sudo cp {{src}} /tmp/._sudo_cp_{{ src | basename }}
  97. with_items: loop|default([0])
  98. - local_action: command sudo chmod +r /tmp/._sudo_cp_{{ src | basename }}
  99. with_items: loop|default([0])
  100. - copy:
  101. dest: '{{ dest }}'
  102. group: '{{ group | default(None) }}'
  103. mode: '{{ mode | default(None) }}'
  104. owner: '{{ owner | default(None) }}'
  105. src: /tmp/._sudo_cp_{{ src | basename }}
  106. with_items: loop|default([0])
  107.  
  108. @end
  109. )
  110.  
  111. configure munge_repo_front (
  112. @begin
  113.  
  114. - apt: name=munge update_cache=yes cache_valid_time=3600
  115. when: ansible_os_family == "Debian"
  116. - when: ansible_os_family == "RedHat"
  117. yum: name=munge
  118. - shell: echo -n "foo" | sha512sum | cut -d' ' -f1 >/etc/munge/munge.key
  119. - shell: chown munge.munge /etc/munge/munge.key
  120. - shell: chmod 400 /etc/munge/munge.key
  121. - file: path=/var/log/munge state=directory mode=0700
  122. - file: path=/var/log state=directory mode=0755
  123. - service: name=munge state=restarted
  124.  
  125. @end
  126. )
  127.  
  128. configure munge_repo_wn (
  129. @begin
  130.  
  131. - apt: name=munge update_cache=yes cache_valid_time=3600
  132. when: ansible_os_family == "Debian"
  133. - when: ansible_os_family == "RedHat"
  134. yum: name=munge
  135. - shell: echo -n "foo" | sha512sum | cut -d' ' -f1 >/etc/munge/munge.key
  136. - shell: chown munge.munge /etc/munge/munge.key
  137. - shell: chmod 400 /etc/munge/munge.key
  138. - file: path=/var/log/munge state=directory mode=0700
  139. - file: path=/var/log state=directory mode=0755
  140. - service: name=munge state=restarted
  141.  
  142.  
  143. @end
  144. )
  145.  
  146. configure Debian (
  147. @begin
  148.  
  149. FIREWALL_SERVICE: iptables
  150.  
  151. @end
  152. )
  153.  
  154. configure RedHat (
  155. @begin
  156.  
  157. FIREWALL_SERVICE: firewalld
  158.  
  159. @end
  160. )
RAW Paste Data