Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Drupal definition results in failure due to undefined 'git' variable #4

Open
geerlingguy opened this issue Jul 22, 2019 · 2 comments

Comments

@geerlingguy
Copy link

When I install this operator in my local cluster using the updated directions in #3, the Drupal instance example-drupal never gets created; instead, the operator keeps trying to build the instance and outputs the following playbook error:

TASK [Drupal] ******************************************************************

task path: /opt/ansible/playbook.yml:61
fatal: [localhost]: FAILED! => {\"msg\": \"The task includes an option with an undefined variable. The error was: 'git' is undefined

The error appears to have been in '/opt/ansible/playbook.yml': line 61, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - name: Drupal
    ^ here
@geerlingguy
Copy link
Author

geerlingguy commented Jul 22, 2019

I'm wondering if the version of the operator on Docker Hub is out of sync with master (https://hub.docker.com/r/8thom/drupal-operator), because I don't see any git variable or even the string git outside of the README.

@geerlingguy
Copy link
Author

geerlingguy commented Jul 22, 2019

Yeah, looks like the playbook version in v0.0.1 has an initContainer which pulls a git repo containing a Drupal codebase, and then runs composer install --no-dev --ignore-platform-reqs on the codebase before passing that via a Docker volume to the Drupal Apache/PHP container:

              initContainers:
                - name: checkout
                  image: alpine/git
                  command:
                    - git
                    - clone
                    - --branch 
                    - '{{ git.branch }}'
                    - --single-branch
                    - --depth
                    - '1'
                    - '{{ git.repo }}'
                    - /app/drupal
                  volumeMounts:
                  - name: drupal-code
                    mountPath: /app/drupal/
                - name: composer
                  image: composer
                  command: 
                    - composer
                    - install
                    - --working-dir=/app/drupal
                    - --no-dev
                    - --ignore-platform-reqs
                  env:
                  - name: COMPOSER_CACHE_DIR
                    value: /composer/cache
                  volumeMounts:
                  - name: drupal-code
                    mountPath: /app/drupal/
                  - name: cache-volume
                    mountPath: /composer/cache/

It looks like there's a type: production attribute in the example CR; maybe you were working on a mode that would do a git clone of a real Drupal codebase to deploy it for a real-world environment, and that never made it up to GitHub, but you did push a new version of the container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant