Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- network private ( )
- network public ( outbound = 'yes' )
- contextualize (
- system front configure front step 1
- system wn configure wn step 2
- )
- deploy front 1 occi
- deploy wn @input.NumNodes@ occi
- system wn (
- disk.0.os.credentials.username = 'centos' and
- #instance_type = 'f0cd78ab-10a0-4350-a6cb-5f3fdd6e6294' and
- instance_type = '3' and
- net_interface.0.connection = 'private' and
- disk.0.os.name = 'linux' and
- #Image for CentOS 7
- #disk.0.image.url = 'ost://cloud-areapd.pd.infn.it/7544a870-90a6-4409-9a7d-5b376c278688'
- #Image for CentOS6
- disk.0.image.url = 'https://nova3.ui.savba.sk:8787/occi1.1/99a4ff5f-e0ad-4bb5-9d6a-54158176d331'
- )
- system front (
- disk.0.os.credentials.username = 'centos' and
- queue_system = 'torque' and
- instance_type = '3' and
- net_interface.0.connection = 'public' and
- net_interface.1.connection = 'private' and
- net_interface.0.dns_name = 'test-ce.test.fedcloud.eu' and
- net_interface.1.dns_name = 'torques.localdomain' and
- disk.0.os.name = 'linux' and
- #Image for CentOS 7
- disk.0.image.url = 'https://nova3.ui.savba.sk:8787/occi1.1/01d4551e-d1ae-454a-b70d-319deec96eef'
- )
- configure add_users (
- @begin
- - group: name=dteam
- - user: name=dteam001 group=dteam uid=18118 generate_ssh_key=yes shell=/bin/bash
- ignore_errors: true
- - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa.pub dest=/home/dteam001/.ssh/id_rsa.pub
- owner=dteam001 group=dteam mode=0644
- name: Copy the id_rsa.pub file to the user
- - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa.pub dest=/home/dteam001/.ssh/authorized_keys
- owner=dteam001 group=dteam mode=0644
- name: Copy the id_rsa.pub file to the user
- - include: sudo_copy.yml src=/home/dteam001/.ssh/id_rsa dest=/home/dteam001/.ssh/id_rsa
- owner=dteam001 group=dteam mode=0600
- name: Copy the id_rsa file to the user
- - template: src=utils/templates/ssh_known_hosts.conf dest=/etc/ssh/ssh_known_hosts
- @end
- )
- configure wn (
- @begin
- - tasks:
- - ignore_errors: true
- command: service iptables stop
- - include_vars: '{{item}}'
- with_first_found:
- - '{{ ansible_os_family }}.yml'
- - RedHat.yml
- - include: add_users.yml
- name: adding users...
- vars:
- NNODES: '@input.NumNodes@'
- @end
- )
- configure front (
- @begin
- - tasks:
- - include_vars: '{{item}}'
- with_first_found:
- - '{{ ansible_os_family }}.yml'
- - RedHat.yml
- - command: hostname test-ce.test.fedcloud.eu
- - yum: name=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- - include: add_users.yml
- name: adding users...
- vars:
- NNODES: '@input.NumNodes@'
- @end
- )
- configure sudo_copy (
- @begin
- - local_action: command sudo cp {{src}} /tmp/._sudo_cp_{{ src | basename }}
- with_items: loop|default([0])
- - local_action: command sudo chmod +r /tmp/._sudo_cp_{{ src | basename }}
- with_items: loop|default([0])
- - copy:
- dest: '{{ dest }}'
- group: '{{ group | default(None) }}'
- mode: '{{ mode | default(None) }}'
- owner: '{{ owner | default(None) }}'
- src: /tmp/._sudo_cp_{{ src | basename }}
- with_items: loop|default([0])
- @end
- )
- configure munge_repo_front (
- @begin
- - apt: name=munge update_cache=yes cache_valid_time=3600
- when: ansible_os_family == "Debian"
- - when: ansible_os_family == "RedHat"
- yum: name=munge
- - shell: echo -n "foo" | sha512sum | cut -d' ' -f1 >/etc/munge/munge.key
- - shell: chown munge.munge /etc/munge/munge.key
- - shell: chmod 400 /etc/munge/munge.key
- - file: path=/var/log/munge state=directory mode=0700
- - file: path=/var/log state=directory mode=0755
- - service: name=munge state=restarted
- @end
- )
- configure munge_repo_wn (
- @begin
- - apt: name=munge update_cache=yes cache_valid_time=3600
- when: ansible_os_family == "Debian"
- - when: ansible_os_family == "RedHat"
- yum: name=munge
- - shell: echo -n "foo" | sha512sum | cut -d' ' -f1 >/etc/munge/munge.key
- - shell: chown munge.munge /etc/munge/munge.key
- - shell: chmod 400 /etc/munge/munge.key
- - file: path=/var/log/munge state=directory mode=0700
- - file: path=/var/log state=directory mode=0755
- - service: name=munge state=restarted
- @end
- )
- configure Debian (
- @begin
- FIREWALL_SERVICE: iptables
- @end
- )
- configure RedHat (
- @begin
- FIREWALL_SERVICE: firewalld
- @end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement