summaryrefslogtreecommitdiffstats
path: root/roles/atomic_base
diff options
context:
space:
mode:
Diffstat (limited to 'roles/atomic_base')
-rw-r--r--roles/atomic_base/README.md56
-rw-r--r--roles/atomic_base/defaults/main.yml2
-rw-r--r--roles/atomic_base/files/bash/bashrc12
-rw-r--r--roles/atomic_base/files/ostree/repo_config10
-rw-r--r--roles/atomic_base/files/system/90-nofile.conf7
-rw-r--r--roles/atomic_base/handlers/main.yml2
-rw-r--r--roles/atomic_base/meta/main.yml19
-rw-r--r--roles/atomic_base/tasks/bash.yml13
-rw-r--r--roles/atomic_base/tasks/cloud_user.yml6
-rw-r--r--roles/atomic_base/tasks/main.yml4
-rw-r--r--roles/atomic_base/tasks/ostree.yml18
-rw-r--r--roles/atomic_base/tasks/system.yml3
-rw-r--r--roles/atomic_base/vars/main.yml2
13 files changed, 154 insertions, 0 deletions
diff --git a/roles/atomic_base/README.md b/roles/atomic_base/README.md
new file mode 100644
index 000000000..8fe3faf7d
--- /dev/null
+++ b/roles/atomic_base/README.md
@@ -0,0 +1,56 @@
+Role Name
+========
+
+The purpose of this role is to do common configurations for all RHEL atomic hosts.
+
+
+Requirements
+------------
+
+None
+
+
+Role Variables
+--------------
+
+None
+
+
+Dependencies
+------------
+
+None
+
+
+Example Playbook
+-------------------------
+
+From a group playbook:
+
+ hosts: servers
+ roles:
+ - ../../roles/atomic_base
+
+
+License
+-------
+
+Copyright 2012-2014 Red Hat, Inc., All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Author Information
+------------------
+
+Thomas Wiest <twiest@redhat.com>
diff --git a/roles/atomic_base/defaults/main.yml b/roles/atomic_base/defaults/main.yml
new file mode 100644
index 000000000..09eac6567
--- /dev/null
+++ b/roles/atomic_base/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+# defaults file for atomic_base
diff --git a/roles/atomic_base/files/bash/bashrc b/roles/atomic_base/files/bash/bashrc
new file mode 100644
index 000000000..446f18f22
--- /dev/null
+++ b/roles/atomic_base/files/bash/bashrc
@@ -0,0 +1,12 @@
+# .bashrc
+
+# User specific aliases and functions
+
+alias rm='rm -i'
+alias cp='cp -i'
+alias mv='mv -i'
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+ . /etc/bashrc
+fi
diff --git a/roles/atomic_base/files/ostree/repo_config b/roles/atomic_base/files/ostree/repo_config
new file mode 100644
index 000000000..7038158f9
--- /dev/null
+++ b/roles/atomic_base/files/ostree/repo_config
@@ -0,0 +1,10 @@
+[core]
+repo_version=1
+mode=bare
+
+[remote "rh-atomic-controller"]
+url=https://mirror.openshift.com/libra/ostree/rhel-7-atomic-host
+branches=rh-atomic-controller/el7/x86_64/buildmaster/controller/docker;
+tls-client-cert-path=/var/lib/yum/client-cert.pem
+tls-client-key-path=/var/lib/yum/client-key.pem
+gpg-verify=false
diff --git a/roles/atomic_base/files/system/90-nofile.conf b/roles/atomic_base/files/system/90-nofile.conf
new file mode 100644
index 000000000..8537a4c5f
--- /dev/null
+++ b/roles/atomic_base/files/system/90-nofile.conf
@@ -0,0 +1,7 @@
+# PAM process file descriptor limits
+# see limits.conf(5) for details.
+#Each line describes a limit for a user in the form:
+#
+#<domain> <type> <item> <value>
+* hard nofile 16384
+root soft nofile 16384
diff --git a/roles/atomic_base/handlers/main.yml b/roles/atomic_base/handlers/main.yml
new file mode 100644
index 000000000..a9481f6c7
--- /dev/null
+++ b/roles/atomic_base/handlers/main.yml
@@ -0,0 +1,2 @@
+---
+# handlers file for atomic_base
diff --git a/roles/atomic_base/meta/main.yml b/roles/atomic_base/meta/main.yml
new file mode 100644
index 000000000..9578ab809
--- /dev/null
+++ b/roles/atomic_base/meta/main.yml
@@ -0,0 +1,19 @@
+---
+galaxy_info:
+ author: Thomas Wiest
+ description: Common base RHEL atomic configurations
+ company: Red Hat
+ # Some suggested licenses:
+ # - BSD (default)
+ # - MIT
+ # - GPLv2
+ # - GPLv3
+ # - Apache
+ # - CC-BY
+ license: Apache
+ min_ansible_version: 1.2
+ platforms:
+ - name: EL
+ versions:
+ - 7
+dependencies: []
diff --git a/roles/atomic_base/tasks/bash.yml b/roles/atomic_base/tasks/bash.yml
new file mode 100644
index 000000000..6e577971a
--- /dev/null
+++ b/roles/atomic_base/tasks/bash.yml
@@ -0,0 +1,13 @@
+---
+- name: Copy .bashrc
+ copy: src=bash/bashrc dest=/root/.bashrc owner=root group=root mode=0644
+
+- name: Link to .profile to .bashrc
+ file: src=/root/.bashrc dest=/root/.profile owner=root group=root state=link
+
+- name: Setup Timezone [{{ oo_timezone }}]
+ file: >
+ src=/usr/share/zoneinfo/{{ oo_timezone }}
+ dest=/etc/localtime
+ owner=root
+ group=root state=link
diff --git a/roles/atomic_base/tasks/cloud_user.yml b/roles/atomic_base/tasks/cloud_user.yml
new file mode 100644
index 000000000..e7347fc3d
--- /dev/null
+++ b/roles/atomic_base/tasks/cloud_user.yml
@@ -0,0 +1,6 @@
+---
+- name: Remove cloud-user account
+ user: name=cloud-user state=absent remove=yes force=yes
+
+- name: Remove cloud-user sudo
+ file: path=/etc/sudoers.d/90-cloud-init-users state=absent
diff --git a/roles/atomic_base/tasks/main.yml b/roles/atomic_base/tasks/main.yml
new file mode 100644
index 000000000..5d8e8571a
--- /dev/null
+++ b/roles/atomic_base/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- include: system.yml
+- include: bash.yml
+- include: ostree.yml
diff --git a/roles/atomic_base/tasks/ostree.yml b/roles/atomic_base/tasks/ostree.yml
new file mode 100644
index 000000000..b9d366f1b
--- /dev/null
+++ b/roles/atomic_base/tasks/ostree.yml
@@ -0,0 +1,18 @@
+---
+- name: Copy ostree repo config
+ copy: >
+ src=ostree/repo_config
+ dest=/ostree/repo/config
+ owner=root
+ group=root
+ mode=0644
+
+- name: "WORK AROUND: Stat redhat repo file"
+ stat: path=/etc/yum.repos.d/redhat.repo
+ register: redhat_repo
+
+- name: "WORK AROUND: subscription manager failures"
+ file: >
+ path=/etc/yum.repos.d/redhat.repo
+ state=touch
+ when: redhat_repo.stat.exists == False
diff --git a/roles/atomic_base/tasks/system.yml b/roles/atomic_base/tasks/system.yml
new file mode 100644
index 000000000..e5cde427d
--- /dev/null
+++ b/roles/atomic_base/tasks/system.yml
@@ -0,0 +1,3 @@
+---
+- name: Upload nofile limits.d file
+ copy: src=system/90-nofile.conf dest=/etc/security/limits.d/90-nofile.conf owner=root group=root mode=0644
diff --git a/roles/atomic_base/vars/main.yml b/roles/atomic_base/vars/main.yml
new file mode 100644
index 000000000..d4e61175c
--- /dev/null
+++ b/roles/atomic_base/vars/main.yml
@@ -0,0 +1,2 @@
+---
+oo_timezone: US/Eastern