Skip to content

Commit

Permalink
Merge branch 'Chrislevi-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
samherve committed May 10, 2017
2 parents 676d350 + 85189f0 commit a21eaf3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
17 changes: 13 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
nexus_version: '3.3.0-01'
nexus_version: '3.3.1-01'
nexus_package: "nexus-{{ nexus_version }}-unix.tar.gz"
nexus_download_dir: '/tmp'
nexus_backup_dir: '/var/nexus-backup'
Expand All @@ -22,6 +22,9 @@ nexus_backup_log: '/var/log/nexus-backup.log'

# Nexus default properties
nexus_default_port: 8081
nexus_docker_hosted_port: 9080
nexus_docker_proxy_port: 9081
nexus_docker_group_port: 9082
nexus_default_context_path: '/'

nexus_admin_password: 'changeme' # Note : admin password change subsequent to first-time install is *not implemented* yet
Expand All @@ -42,6 +45,9 @@ ldap_connections: []
# ldap_protocol: 'ldaps' # ldap or ldaps
# ldap_hostname: 'ldap.mycompany.com'
# ldap_port: 636
# ldap_auth: 'simple' or 'none'
# ldap_auth_username: 'username' (or DN) (optional)
# ldap_auth_password: 'password' (optional)
# ldap_search_base: 'dc=mycompany,dc=net'
# ldap_user_base_dn: 'ou=users'
# ldap_user_object_class: 'inetOrgPerson'
Expand Down Expand Up @@ -229,21 +235,24 @@ _nexus_repos_docker_defaults:

nexus_repos_docker_hosted:
- name: docker-hosted
http_port: 9080
http_port: "{{ nexus_docker_hosted_port }}"
v1_enabled: True

nexus_repos_docker_proxy:
- name: docker-proxy
http_port: 9081
http_port: "{{ nexus_docker_proxy_port }}"
v1_enabled: True
index_type: "HUB"
proxy_url: "https://registry-1.docker.io"
use_nexus_certificates_to_access_index: false

nexus_repos_docker_group:
- name: docker-group
http_port: 9082
http_port: "{{ nexus_docker_group_port }}"
v1_enabled: True
member_repos:
- docker-hosted
- docker-proxy

# RubyGems support
_nexus_repos_rubygems_defaults:
Expand Down
5 changes: 1 addition & 4 deletions files/groovy/create_repo_docker_group.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ configuration = new Configuration(
v1Enabled : parsed_args.v1_enabled
],
group: [
memberNames: [
"private-registry",
"proxy-registry"
]
memberNames: parsed_args.member_repos
],
storage: [
writePolicy: parsed_args.write_policy.toUpperCase(),
Expand Down
9 changes: 8 additions & 1 deletion files/groovy/setup_ldap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ ldapConfig.setName(parsed_args.name)
// Connection
connection = new Connection()
connection.setHost(new Connection.Host(Connection.Protocol.valueOf(parsed_args.protocol), parsed_args.hostname, Integer.valueOf(parsed_args.port)))
connection.setAuthScheme("none")
if(parsed_args.auth != null && parsed_args.auth.equals("simple")){
connection.setAuthScheme("simple")
connection.setSystemUsername(parsed_args.username)
connection.setSystemPassword(parsed_args.password)
}
else {
connection.setAuthScheme("none")
}
connection.setSearchBase(parsed_args.search_base)
connection.setConnectionTimeout(30)
connection.setConnectionRetryDelay(300)
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<description>Fake project meant to be imported in an IDE (IntelliJ) to edit groovy scripts with classpath-aware completion</description>

<properties>
<nx-version>3.0.2-02</nx-version>
<nx-version>3.3.1-01</nx-version>
</properties>
<build>
<sourceDirectory>templates/groovy</sourceDirectory>
<sourceDirectory>files/groovy</sourceDirectory>
</build>
<dependencies>
<dependency>
Expand Down
3 changes: 3 additions & 0 deletions tasks/setup_ldap_each.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
protocol: "{{ item.ldap_protocol }}"
hostname: "{{ item.ldap_hostname }}"
port: "{{ item.ldap_port }}"
auth: "{{ item.ldap_auth | default('none') }}"
username: "{{ item.ldap_auth_username | default('') }}"
password: "{{ item.ldap_auth_password | default('') }}"
search_base: "{{ item.ldap_search_base }}"
user_base_dn: "{{ item.ldap_user_base_dn }}"
user_object_class: "{{ item.ldap_user_object_class }}"
Expand Down

0 comments on commit a21eaf3

Please sign in to comment.