Skip to content
Snippets Groups Projects
Commit c1397c0e authored by Chris Hines's avatar Chris Hines
Browse files

Merge pull request #24 from CVL-GitHub/slumbranch

Fixed nfs client mount for different options
parents 81251ca3 99410a35
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 83 deletions
---
- name: "Copying CA and server certificate"
shell: "cp -pvf /etc/easy-rsa/2.0/keys/ca.crt /etc/openvpn/; cp -pvf /etc/easy-rsa/2.0/keys/{{ inventory_hostname }}.crt /etc/openvpn/; cp -pvf /etc/easy-rsa/2.0/keys/{{ inventory_hostname }}.key /etc/openvpn/"
args:
creates: /etc/openvpn/ca.crt
- name: "Create symlink for Diffie Hellman"
file: "src=/etc/easy-rsa/2.0/keys/dh512.pem dest=/etc/openvpn/dh512.pem state=link"
- name: "Copying server.conf to the OpenVPN server"
template: src={{ item }} dest=/etc/openvpn/server.conf
with_first_found:
- files:
- server.conf.j2
- userConfig
- defaultConfig
paths:
- ../templates/
- ../files/
notify: restart openvpn
- name: "Start OpenVPN"
service: name=openvpn state=started
sudo: true
--- ---
nfs_server: "nfsserver.edu" nfsClientSrcDir: '/mnt'
nfs_type: "nfs" nfsClientDestDir: '/mnt/test-nfs'
nfs_options: "vers=3,noatime,rsize=16384,wsize=16384,hard,intr,tcp,nolock" nfs_server: 'nfsserver.edu'
nfs_type: 'nfs'
nfs_options: 'vers=3,noatime,rsize=16384,wsize=16384,hard,intr,tcp,nolock'
--- ---
- - name: "Mounting NFS mounts"
name: "Get the NFS Network" mount: "name={{ nfsClientDestDir }} src={{ nfs_server }}:{{ nfsClientSrcDir }} fstype={{ nfs_type }} opts={{ nfs_options }} state=mounted"
setup: filter="ansible_tun0"
register: nfsServer
run_once: true
delegate_to: "{{ nfs_server }}"
-
mount: "name={{ item.0 }} src={{ nfsServer['ansible_facts']['ansible_tun0']['ipv4']['address'] }}:{{ item.1 }} fstype={{ nfs_type }} opts={{ nfs_options }} state=mounted"
name: "Mounting NFS mounts"
with_together:
- destDir
- srcDir
notify: "restart authentication" notify: "restart authentication"
notify: "restart idmap" notify: "restart idmap"
sudo: true sudo: true
......
---
srcDir: ['/mnt']
destDir: ['/mnt/test-nfs']
--- ---
- - name: "Copying /etc/exports template"
name: "Starting rpcbind" template: "src=exports.j2 dest=/etc/exports mode=0644 owner=root"
service: "name=rpcbind state=started" sudo: true
- - name: "Starting rpcbind"
name: "Start the Server" service: "name=rpcbind state=restarted"
service: "name=nfs state=started" sudo: true
- name: "Start the Server"
service: "name=nfs state=restarted"
sudo: true
--- ---
- name: auth config
shell: authconfig --updateall
sudo: true
- name: restart sssd - name: restart sssd
service: name=sssd state=restarted service: name=sssd state=restarted
sudo: true sudo: true
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
lineinfile: dest=/etc/hosts line="{{ ldapServerHost }}" state=present insertafter=EOF lineinfile: dest=/etc/hosts line="{{ ldapServerHost }}" state=present insertafter=EOF
sudo: true sudo: true
- name: "Copy ldap.conf file " - name: "Copy ldap.conf file"
template: src=ldap.conf.j2 dest=/etc/openldap/ldap.conf template: src=ldap.conf.j2 dest=/etc/openldap/ldap.conf
sudo: true sudo: true
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
- name: "Copy sssd.conf to ldap client" - name: "Copy sssd.conf to ldap client"
template: src=sssd.j2 dest=/etc/sssd/sssd.conf owner=root group=root mode=600 template: src=sssd.j2 dest=/etc/sssd/sssd.conf owner=root group=root mode=600
sudo: true sudo: true
notify: auth config notify: restart sssd
--- ---
- -
include: installOpenLdap.yml include: installOpenLdap.yml
- -
include: configLdapClient.yml include: configLdapClient.yml
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#Verbosity = 0 #Verbosity = 0
# The following should be set to the local NFSv4 domain name # The following should be set to the local NFSv4 domain name
# The default is the host's DNS domain name. # The default is the host's DNS domain name.
Domain = {{ ldapDomain }} Domain = {{ ldapDomain }}
# The following is a comma-separated list of Kerberos realm # The following is a comma-separated list of Kerberos realm
# names that should be considered to be equivalent to the # names that should be considered to be equivalent to the
......
TLS_CACERTDIR {{ tlsCaCertDirectory }} TLS_CACERTDIR {{ tlsCaCertDirectory }}
TLS_CACERT {{ tlsCaCertFile }} TLS_CACERT {{ tlsCaCertFile }}
URI {{ ldapUri }} URI {{ ldapUri }}
BASE {{ ldapBase }} BASE {{ ldapBase }}
timelimit 120 timelimit 120
bind_timelimit 120 bind_timelimit 120
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#shadow: db files nisplus nis #shadow: db files nisplus nis
#group: db files nisplus nis #group: db files nisplus nis
passwd: files ldap passwd: files sss
shadow: files ldap shadow: files sss
group: files ldap group: files sss
#hosts: db files nisplus nis dns #hosts: db files nisplus nis dns
hosts: files dns hosts: files dns
...@@ -52,9 +52,9 @@ netmasks: files ...@@ -52,9 +52,9 @@ netmasks: files
networks: files networks: files
protocols: files protocols: files
rpc: files rpc: files
services: files services: files sss
netgroup: files ldap netgroup: files sss
publickey: nisplus publickey: nisplus
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#host 127.0.0.1 #host 127.0.0.1
# The distinguished name of the search base. # The distinguished name of the search base.
base {{ ldapBase }} base {{ ldapBase }}
# Another way to specify your LDAP server is to provide an # Another way to specify your LDAP server is to provide an
# uri with the server name. This allows to use # uri with the server name. This allows to use
...@@ -27,7 +27,7 @@ base {{ ldapBase }} ...@@ -27,7 +27,7 @@ base {{ ldapBase }}
#uri ldapi://%2fvar%2frun%2fldapi_sock/ #uri ldapi://%2fvar%2frun%2fldapi_sock/
# Note: %2f encodes the '/' used as directory separator # Note: %2f encodes the '/' used as directory separator
# [aulmc used to be 11/10/2013 # uri ldap://m2-w.massive.org.au/ # [aulmc used to be 11/10/2013 # uri ldap://m2-w.massive.org.au/
uri {{ ldapDomain }} uri {{ ldapDomain }}
# The LDAP version to use (defaults to 3 # The LDAP version to use (defaults to 3
# if supported by client library) # if supported by client library)
...@@ -39,7 +39,7 @@ binddn {{ ldapDn }} ...@@ -39,7 +39,7 @@ binddn {{ ldapDn }}
# The credentials to bind with. # The credentials to bind with.
# Optional: default is no credential. # Optional: default is no credential.
bindpw {{ ldapPassword }} bindpw {{ ldapPassword }}
# The distinguished name to bind to the server with # The distinguished name to bind to the server with
# if the effective user ID is root. Password is # if the effective user ID is root. Password is
...@@ -300,7 +300,7 @@ pam_password md5 ...@@ -300,7 +300,7 @@ pam_password md5
ssl no ssl no
#tls_cacertdir /etc/openldap/cacerts #tls_cacertdir /etc/openldap/cacerts
#pam_password md5 #pam_password md5
tls_cacertdir {{ tlsCaCertDirectory }} tls_cacertdir {{ tlsCaCertDirectory }}
tls_cacertfile {{ tlsCaCertFile }} tls_cacertfile {{ tlsCaCertFile }}
{{ ldapRfc2307Pam }} {{ ldapRfc2307Pam }}
...@@ -2,18 +2,13 @@ ...@@ -2,18 +2,13 @@
config_file_version = 2 config_file_version = 2
domains = {{ ldapDomain }} domains = {{ ldapDomain }}
services = nss, pam, autofs services = nss, pam, autofs
# SSSD will not start if you do not configure any domains.
# Add new domain configurations as [domain/<NAME>] sections, and
# then add the list of domains (in the order you want them to be
# queried) to the "domains" attribute below and uncomment it.
; domains = LDAP
[nss] [nss]
filter_users = root filter_users = root
[pam] [pam]
[domain/{{ ldapDomain}}] [domain/{{ ldapDomain }}]
ldap_referrals = false ldap_referrals = false
cache_credentials = false cache_credentials = false
entry_cache_timeout=3600 entry_cache_timeout=3600
...@@ -28,11 +23,11 @@ access_provider = ldap ...@@ -28,11 +23,11 @@ access_provider = ldap
ldap_uri = {{ ldapUri }} ldap_uri = {{ ldapUri }}
ldap_id_use_start_tls = True ldap_id_use_start_tls = True
ldap_tls_reqcert = allow ldap_tls_reqcert = allow
ldap_tls_cacertdir = {{ tlsCaCertDirectory }} ldap_tls_cacertdir = {{ tlsCaCertDirectory }}
ldap_tls_cacert = {{ cacertFile }} ldap_tls_cacert = {{ cacertFile }}
ldap_default_bind_dn = {{ ldapDn }} ldap_default_bind_dn = {{ ldapDn }}
ldap_default_authtok_type = password ldap_default_authtok_type = password
ldap_default_authtok = {{ ldapPassword }} ldap_default_authtok = {{ ldapPassword }}
{{ ldapRfc2307 }} {{ ldapRfc2307 }}
......
...@@ -31,10 +31,15 @@ ...@@ -31,10 +31,15 @@
chdir: /tmp chdir: /tmp
creates: /tmp/slurm-{{ slurm_version }}.tar.bz2 creates: /tmp/slurm-{{ slurm_version }}.tar.bz2
- name: check munge installation
shell: rpm -qa munge
register: munge_installed
- name: install munge deps - name: install munge deps
shell: rpm -i /root/rpmbuild/RPMS/x86_64/munge-libs-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-devel-{{ munge_version }}-1.el6.x86_64.rpm shell: rpm -i /root/rpmbuild/RPMS/x86_64/munge-libs-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-devel-{{ munge_version }}-1.el6.x86_64.rpm
sudo: true sudo: true
ignore_errors: true # ignore_errors: true
when: munge_installed | failed
- name: make slurm rpms - name: make slurm rpms
shell: rpmbuild -ta --clean slurm-{{ slurm_version }}.tar.bz2 shell: rpmbuild -ta --clean slurm-{{ slurm_version }}.tar.bz2
...@@ -49,7 +54,15 @@ ...@@ -49,7 +54,15 @@
args: args:
creates: /tmp/rpmbuild/RPMS/x86_64/slurm-{{ slurm_version }}-1.el6.x86_64.rpm creates: /tmp/rpmbuild/RPMS/x86_64/slurm-{{ slurm_version }}-1.el6.x86_64.rpm
#- name: retrieve rpms
# shell: scp -r {{ hostvars[ansible_hostname]['ansible_user_id'] }}@{{ ansible_ssh_host }}:/tmp/rpmbuild/ /tmp
# delegate_to: 127.0.0.1
# when: ansible_ssh_host | defined
# when: ansible_ssh_host | defined
# sudo: true
- name: retrieve rpms - name: retrieve rpms
shell: scp -r {{ hostvars[ansible_hostname]['ansible_user_id'] }}@{{ ansible_ssh_host }}:/tmp/rpmbuild/ /tmp shell: scp -r {{ hostvars[ansible_hostname]['ansible_user_id'] }}@{{ ansible_hostname }}:/tmp/rpmbuild/ /tmp
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
# when: ansible_ssh_host | not defined
...@@ -25,13 +25,10 @@ try: ...@@ -25,13 +25,10 @@ try:
f=open(pwpath,'r') f=open(pwpath,'r')
data=yaml.load(f.read()) data=yaml.load(f.read())
f.close() f.close()
print data
except Exception as e: except Exception as e:
pass
if data==None:
data={} data={}
print data
for pw in required_passwords.keys(): for pw in required_passwords.keys():
if data.has_key(pw): if data.has_key(pw):
pass pass
......
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
- hosts: ComputeNodes:ManagmentNodes:LoginNodes - hosts: ComputeNodes:ManagmentNodes:LoginNodes
vars: vars:
slurm_version: 14.11.0
munge_version: 0.5.11
slurmqueues: slurmqueues:
- {name: batch, group: ComputeNodes} - {name: batch, group: ComputeNodes}
slurmctrl: "{{ groups['ManagmentNodes'][0] }}" slurmctrl: "{{ groups['ManagmentNodes'][0] }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment